-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle use case when canvas size is already controlled by css #20956
Conversation
- implementation is inspired by SDL implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
lgtm % nits
@sbc100 I applied your code review. Thank you. |
All tests ran. The primary test for this change is working fine:
The only failing test in
This failing test does not seem to be related to my changes (note that Thank you |
@sbc100 I just pushed a small addition which does 2 things:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
When I was checking the SDL implementation I noticed that they were doing something like this:
Then they use this flag
wdata->external_size
to not rewrite the css property, for example:I changed the glfw code to use the same "trick" and implement a similar logic. This way there is no need to wrap the canvas in a
<div>
when the canvas needs to be full window (width: 100% / height: 100%
)