Merge pull request 'fix(web): use adapter limits so /play renders at native res (no 2048 cap)' (#101) from test/web-adapter-limits into master
This commit was merged in pull request #101.
This commit is contained in:
@@ -7,23 +7,10 @@
|
||||
<style>
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
html, body { height: 100%; background: #000; overflow: hidden; }
|
||||
/* Cap the canvas at WebGL2's 2048 max texture dimension (this mirrors
|
||||
the Window `resize_constraints` in solitaire_web/src/lib.rs — winit
|
||||
applies that constraint as the canvas's own max-width/max-height).
|
||||
On wasm Bevy creates the device with downlevel_webgl2_defaults()
|
||||
whose max_texture_dimension_2d is a fixed 2048, so a larger surface
|
||||
(e.g. a 4K display at 150% scale → a 2560x1440 logical viewport)
|
||||
makes Surface::configure panic. `max-*` directly on the canvas keeps
|
||||
the surface ≤ 2048 regardless of how fit_canvas_to_parent resolves
|
||||
its 100% width; `margin: 0 auto` centres the letterbox horizontally. */
|
||||
#bevy-canvas {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
max-width: 2048px;
|
||||
max-height: 2048px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
/* No size cap: the wgpu device now takes its max_texture_dimension from
|
||||
the adapter (see solitaire_web/src/lib.rs), so the surface can match
|
||||
the full viewport. fit_canvas_to_parent sizes the canvas to 100%. */
|
||||
#bevy-canvas { display: block; width: 100%; height: 100%; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user