fix(web): clamp wgpu surface to CSS pixels on HiDPI to prevent wasm panic
Root cause: fit_canvas_to_parent requests a wgpu surface sized in physical pixels (CSS pixels × devicePixelRatio). On HiDPI displays (DPR ≈ 2) the physical size (e.g. 2612×1469) exceeds WebGL2's per- dimension texture limit of 2048, triggering a wgpu validation panic that kills the WASM thread immediately on the first window resize. Fix: add `resolution: WindowResolution::default().with_scale_factor_override(1.0)` to the primary window so Bevy uses CSS/logical pixels as the surface dimensions. For a 1306×734 CSS viewport this keeps the framebuffer well within 2048 regardless of devicePixelRatio. Also remove the temporary [drag] console logging added in the previous commit — the panic was causing drag to never run, not a hit-test bug. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
Reference in New Issue
Block a user