Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
moufmouf opened this issue May 15, 2024 · 1 comment · May be fixed by #6819
Open

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

moufmouf opened this issue May 15, 2024 · 1 comment · May be fixed by #6819

Comments

@moufmouf
Copy link
Contributor

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.

@moufmouf moufmouf linked a pull request May 15, 2024 that will close this issue
@moufmouf
Copy link
Contributor Author

Note: this is a duplicate of #6607 (sorry for opening the duplicate) and I provided a fix in this PR: #6819

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant