Skip to content

size emscripten canvas from iframe - #187

Merged
treeform merged 1 commit into
masterfrom
iframe-canvas-size
Aug 26, 2026
Merged

size emscripten canvas from iframe#187
treeform merged 1 commit into
masterfrom
iframe-canvas-size

Conversation

@treeform

Copy link
Copy Markdown
Owner

Summary

  • Read Emscripten window size from the canvas element (clientWidth/clientHeight) instead of window.innerWidth, so WASM apps inside an iframe use the iframe box.
  • Observe canvas resizes and dispatch resize so the framebuffer tracks the iframe when the parent layout changes.

Test plan

  • Full-page Emscripten window still fills the browser and UI scale is unchanged.
  • Same build inside a small iframe uses the iframe size, not the parent window.
  • Resizing the iframe updates the canvas backing store.

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@treeform
treeform merged commit e4eb95a into master Aug 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant