Remove CanvasParentResizePlugin#11057
Conversation
|
You appear to be missing an issue link :) |
|
It looks like your PR is a breaking change, but you didn't provide a migration guide. Could you add some context on what users should update when this change get released in a new version of Bevy? |
tim-blackbird
left a comment
There was a problem hiding this comment.
When the website gets updated for the 0.13 release we can revert bevyengine/bevy-website#640.
|
Really excited for this! :) I think this will make it simpler to avoid a flicker due to incorrect sizing on first load of my WASM app! |
|
A migration guide would be appreciated.
|
|
@cshenton-work I've noted what needs to be done in #11052 (comment):
So until this is hopefully addressed in Bevy, just get the canvas and apply EDIT: I can actually see that the commit has added a migration guide: 80f15e0. I assume this will be later compiled into the changelog. |
Implemented suggestions from reviewers: a simpler fit_canvas_to_parent leads to an explicit CSS setting to the canvas. It has do be set after wgpu creation due to wgpu overriding the canvas width/height: https://github.com/gfx-rs/wgpu/blob/4400a5847080d1164bdca93a90622414963ed9f3/examples/src/utils.rs#L68-L74
Implemented suggestions from reviewers: a simpler fit_canvas_to_parent leads to an explicit CSS setting to the canvas. It has do be set after wgpu creation due to wgpu overriding the canvas width/height: https://github.com/gfx-rs/wgpu/blob/4400a5847080d1164bdca93a90622414963ed9f3/examples/src/utils.rs#L68-L74
|
The CSS replacement of |
Your width/height 100% isn't taking precedent over other stylings set programmatically. |
|
@MeoMix To my knowledge, I am not setting them programmatically in my project |
|
1280 x 720 is coming from Bevy: bevy/crates/bevy_window/src/window.rs Lines 631 to 632 in caa7ec6 |
|
It seems like it's being set by winit: |
|
Understood. #11278 It sort of looks like this PR wanted to get merged in but didn't make it? |
|
In the meantime I believe a workaround has been to set the width/height of the container div/html |
Set it to what? |
|
To 100%. (Or the size you want your inner canvas to be) |
Implemented suggestions from reviewers: a simpler fit_canvas_to_parent leads to an explicit CSS setting to the canvas. It has do be set after wgpu creation due to wgpu overriding the canvas width/height: https://github.com/gfx-rs/wgpu/blob/4400a5847080d1164bdca93a90622414963ed9f3/examples/src/utils.rs#L68-L74
Follow up to #11057 Implemented suggestions from reviewers from: a simpler fit_canvas_to_parent leads to an explicit CSS setting to the canvas. From my understanding, it has do be set after wgpu creation due to wgpu overriding the canvas width/height: https://github.com/gfx-rs/wgpu/blob/4400a5847080d1164bdca93a90622414963ed9f3/examples/src/utils.rs#L68-L74 # Changelog - Re-enable a `fit_canvas_to_parent`, it's removal from #11057 was problematic. Still, its inner working is more simple than before: bevy doesn't handle its resizing, winit does. ## Migration Guide - Cancels the migration from #11057
Follow up to bevyengine#11057 Implemented suggestions from reviewers from: a simpler fit_canvas_to_parent leads to an explicit CSS setting to the canvas. From my understanding, it has do be set after wgpu creation due to wgpu overriding the canvas width/height: https://github.com/gfx-rs/wgpu/blob/4400a5847080d1164bdca93a90622414963ed9f3/examples/src/utils.rs#L68-L74 # Changelog - Re-enable a `fit_canvas_to_parent`, it's removal from bevyengine#11057 was problematic. Still, its inner working is more simple than before: bevy doesn't handle its resizing, winit does. ## Migration Guide - Cancels the migration from bevyengine#11057
Follow up to bevyengine#11057 Implemented suggestions from reviewers from: a simpler fit_canvas_to_parent leads to an explicit CSS setting to the canvas. From my understanding, it has do be set after wgpu creation due to wgpu overriding the canvas width/height: https://github.com/gfx-rs/wgpu/blob/4400a5847080d1164bdca93a90622414963ed9f3/examples/src/utils.rs#L68-L74 # Changelog - Re-enable a `fit_canvas_to_parent`, it's removal from bevyengine#11057 was problematic. Still, its inner working is more simple than before: bevy doesn't handle its resizing, winit does. ## Migration Guide - Cancels the migration from bevyengine#11057
Follow up to bevyengine#11057 Implemented suggestions from reviewers from: a simpler fit_canvas_to_parent leads to an explicit CSS setting to the canvas. From my understanding, it has do be set after wgpu creation due to wgpu overriding the canvas width/height: https://github.com/gfx-rs/wgpu/blob/4400a5847080d1164bdca93a90622414963ed9f3/examples/src/utils.rs#L68-L74 # Changelog - Re-enable a `fit_canvas_to_parent`, it's removal from bevyengine#11057 was problematic. Still, its inner working is more simple than before: bevy doesn't handle its resizing, winit does. ## Migration Guide - Cancels the migration from bevyengine#11057
Follow up to bevyengine#11057 Implemented suggestions from reviewers from: a simpler fit_canvas_to_parent leads to an explicit CSS setting to the canvas. From my understanding, it has do be set after wgpu creation due to wgpu overriding the canvas width/height: https://github.com/gfx-rs/wgpu/blob/4400a5847080d1164bdca93a90622414963ed9f3/examples/src/utils.rs#L68-L74 # Changelog - Re-enable a `fit_canvas_to_parent`, it's removal from bevyengine#11057 was problematic. Still, its inner working is more simple than before: bevy doesn't handle its resizing, winit does. ## Migration Guide - Cancels the migration from bevyengine#11057

Improves #11052
Changelog
Window::fit_canvas_to_parent, as its resizing on wasm now respects its CSS configuration.Migration Guide
Window::fit_canvas_to_parentin favor of CSS properties, for example: