Skip to content

On web, the window module always resizes the <canvas> #339

Description

@silverlyra

👋🏻 Hello!

I’m using three-d’s window module, and I’d like to keep doing so – it’s a convenient wrapper around winit, and I’d rather work with three-d’s FrameInput and Event types.

But I’m trying to use three-d to render to <canvas> that exists within the layout of its web page, and since 34287bd, three-d resizes the canvas to have the same inner width and height as its parent window. Because this happens unconditionally in render_loop, I can’t work around this, even via from_winit_window.

I could fork three-d and remove that, but if you’re open to changing this behavior or making it optional, I’d like to start a discussion about how the API could change, and I’d be happy to open a PR to implement it.

winit itself always sets an explicit canvas size, which is also behavior that I wish I could opt out of. But for my purposes, a size field on WindowSettings for wasm targets, or even respecting the existing max_size field, would work perfectly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions