Skip to content

DomElement position is not kept correctly in the scene when a camera zooms out #6817

@moufmouf

Description

@moufmouf

Version

  • Phaser Version: 3.80.1 (also occurs in previous versions)
  • Operating system: All
  • Browser: All

Description

When using the camera zoom, DOMElements on the scene will not stay at their correct position (unless you set the DomElement origin to (0,0)

Example Test Code

https://phaser.io/sandbox/jBN4oJxC

In the example above, you will see that the sprite and the DomElement are placed at the same position.
Yet, when we zoom out, the DomElement slightly moves to the bottom right. It shouldn't

Additional Information

I'm willing to help fix this and provide a PR but I would need a bit of guidance.
I traced back the issue probably to DOMElementCSSRenderer.js but I'm not sure where to look further.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions