Skip to content

Canvas size calculation error #108013

Open
Open
@rpahut

Description

@rpahut

Tested versions

The issue is discovered in 3.6 .
Possibly was introduced with GodotDisplayScreen class back in 2021.

System information

Does not appear to be system or browser specific

Issue description

GodotDisplayScreen.updateSize() does not handle calculations correctly, resulting in wrong canvas dimensions when browser zoom is applied. Occasionally this leads to scroll bars appearing over a canvas that is expected to fit the window.

Steps to reproduce

  1. Export HTML project with Canvas Resize Policy set to Adaptive
  2. Run in browser
  3. Zoom in using browser controls to 110%, 125%, other values

Minimal reproduction project (MRP)

ZoomRepro.zip

also for example https://html-classic.itch.zone/html/12218877/index.html
Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    For team assessment

    Status

    For team assessment

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions