Skip to content

[rcore_web] Canvas is incorrectly scaled when window size is applied #4464

@deathbeam

Description

@deathbeam

The deployed example works fine: https://www.raylib.com/examples/core/core_2d_camera_mouse_zoom.html

Latest master (281ee51) behaviour is input gets translated incorrectly and on initial load the canvas is not scaled and positioned incorrectly in bottom-left corner as well. This is because of width: 100% in template that tries to scale the canvas, but this most likely fails to scale the underlying window:

image

See #4455 for original discussion.

Reproduction steps are simply using latest emsdk master, then navigating to raylib src/ directory, running:

make PLATFORM=PLATFORM_WEB -B

then navigating to examples/ directory and running:

make PLATFORM=PLATFORM_WEB -B

and then running:

emrun --port 8080 core/core_2d_camera_mouse_zoom.html

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