mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 20:53:53 +00:00
8cf5fbbf94
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:
4400a58470/examples/src/utils.rs (L68-L74)
# Changelog
- Re-enable a `fit_canvas_to_parent`, it's removal from
https://github.com/bevyengine/bevy/pull/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
https://github.com/bevyengine/bevy/pull/11057
27 lines
537 B
HTML
27 lines
537 B
HTML
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<style>
|
|
body {
|
|
background: linear-gradient(
|
|
135deg,
|
|
white 0%,
|
|
white 49%,
|
|
black 49%,
|
|
black 51%,
|
|
white 51%,
|
|
white 100%
|
|
) repeat;
|
|
background-size: 20px 20px;
|
|
}
|
|
canvas {
|
|
background-color: white;
|
|
}
|
|
</style>
|
|
<title>WASM Example</title>
|
|
</head>
|
|
<script type="module">
|
|
import init from './target/wasm_example.js'
|
|
init()
|
|
</script>
|
|
</html>
|