fix: set current size in Canvas::create based on inner_size attribute#3502
fix: set current size in Canvas::create based on inner_size attribute#3502nicksenger wants to merge 1 commit into
Conversation
de49da6 to
823baf7
Compare
|
The reason why the size isn't immediately available is because there is currently no way to retrieve the actual size of the canvas in pixel synchronously. For context: Unfortunately this API is event-based, so we receive the size of the canvas in an event, so until we receive this event we don't know the actual size of the canvas. We have decided that this is currently the best course of action unless we want to introduce a larger API surface which can tell the user if the size returned by You can see the history and research on this here: #2859. Your current implementation changes the size reported by With that in mind I will close the PR. Please let me know if you have any suggestions on how to tackle this problem other then #2863! |
|
Thanks a lot for the clarification! I figured this was just a weird corner-case, but seems like its been given a fair bit of thought already. |
This PR updates
Canvas::createto set thecurrent_sizebased onattr.inner_sizeif present. This allows the window size to be used immediately on web.CHANGELOG.mdif knowledge of this change could be valuable to users