Skip to content

Fix example canvas growing on resize#640

Merged
cart merged 2 commits intobevyengine:mainfrom
tim-blackbird:fix-growing-example-canvas
May 19, 2023
Merged

Fix example canvas growing on resize#640
cart merged 2 commits intobevyengine:mainfrom
tim-blackbird:fix-growing-example-canvas

Conversation

@tim-blackbird
Copy link
Copy Markdown
Contributor

Prevent the fit_canvas_to_parent setting from growing the canvas by locking the aspect ratio to that of the initial resolution of the bevy Window.

Fixes #432.

@mockersf
Copy link
Copy Markdown
Member

Could you also do this fix on https://github.com/bevyengine/bevy-website/blob/main/templates/example-webgpu.html?

Use single quotes instead to match existing code.
Move progress bar variable declarations.
@tim-blackbird
Copy link
Copy Markdown
Contributor Author

Done. Might deduplicate this later since we have a templating system already.

@cart cart added this pull request to the merge queue May 19, 2023
Merged via the queue into bevyengine:main with commit 9695ac0 May 19, 2023
@mockersf
Copy link
Copy Markdown
Member

Done. Might deduplicate this later since we have a templating system already.

Definitely! After the 0.11 release. The WebGL2 example should become closer to the WebGPU page, list every example with wasm = true, use screenshots, ... Right now it would be cheating as the screenshots used for WebGPU are from the 0.11. And the script is not yet available on the latest branch anyway.

@tim-blackbird tim-blackbird deleted the fix-growing-example-canvas branch July 8, 2023 10:54
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.

Example canvas now grows on each resize

3 participants