Skip to content

Bevy ignores explicit canvas size on web/webgpu platform #20164

@rectalogic

Description

@rectalogic

Bevy version

0.16.1

What you did

I specify a specific width/height on an HTML canvas
<canvas id="bevy-canvas" width="640" height="360"></canvas>,
I set the canvas id on my primary window:

app.add_plugins((DefaultPlugins.set(WindowPlugin {
    primary_window: Some(Window {
        canvas: Some("#bevy-canvas".into()),
        ..default()
    }),
    ..default()
})

What went wrong

Bevy resized my canvas to 1280x720:

Image

Additional information

Repository reproducing the issue https://github.com/rectalogic/bevy_canvas_size

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-WindowingPlatform-agnostic interface layer to run your app inO-WebSpecific to web (WASM) builds

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions