Repository navigation
Respect CSS resize in window handling - #366
Merged
waynemwashuma merged 1 commit intoSep 21, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Fix DOM canvas resizing so CSS controls the canvas display size and resize events are emitted when either dimension changes.
Solution
Canvas initialization now reads the computed layout size without overwriting CSS dimensions. The resize system also updates the window whenever the canvas width or height changes.
Root Cause
The canvas registration logic assigned inline
widthandheightstyles from the initial window dimensions, overriding sizes defined by external CSS.Additionally, the resize system returned early when either dimension remained unchanged. This prevented valid single-axis resizes from being detected.
Changes Made
Windowdimensions with its bounding rectangle.Why This Approach
This keeps layout control within CSS while allowing the engine to synchronize its window dimensions with the canvas’s rendered size. It also correctly handles responsive layouts where only one dimension changes.
Notes
Showcase
Before
The engine applied inline pixel dimensions during initialization, which could override the CSS layout. A change to only one dimension could also be ignored.
After
The CSS dimensions remain in control, and the engine synchronizes the
Windowwhenever the rendered width or height changes.Migration Guide
No migration required.
Checklist