diff --git a/source/package-lock.json b/source/package-lock.json index 9877897..8226917 100644 --- a/source/package-lock.json +++ b/source/package-lock.json @@ -1,12 +1,12 @@ { "name": "@funky-flask-test/funky-flask-test", - "version": "1.3.10", + "version": "1.3.11", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@funky-flask-test/funky-flask-test", - "version": "1.3.10", + "version": "1.3.11", "devDependencies": { "@types/node": "^24.0.15", "typescript": "^5.8.3", diff --git a/source/package.json b/source/package.json index e69e205..6bf5443 100644 --- a/source/package.json +++ b/source/package.json @@ -1,6 +1,6 @@ { "name": "@funky-flask-test/funky-flask-test", - "version": "1.3.10", + "version": "1.3.11", "type": "module", "main": "./dist/index.jsx", "exports": { diff --git a/source/src/index.tsx b/source/src/index.tsx index eaadba0..d04cb44 100644 --- a/source/src/index.tsx +++ b/source/src/index.tsx @@ -29,8 +29,16 @@ export class RickGamePanel { private createUI() { const panel = document.createElement('div') this.canvas = document.createElement('canvas') - this.canvas.style.cssText = `width: 100%; border: 2px solid #333; background: #000; cursor: pointer;` + this.canvas.style.cssText = `border: 2px solid #333; background: #000; cursor: pointer;` panel.appendChild(this.canvas) + + // Wait for panel to be in DOM to get computed size + requestAnimationFrame(() => { + const rect = panel.getBoundingClientRect() + this.canvas.width = rect.width + this.canvas.height = rect.height + }) + this.container.appendChild(panel) }