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

Fixing DomElement position when camera zoom != 1 #6819

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

moufmouf
Copy link
Contributor

This PR (delete as applicable)

  • Fixes a bug

Describe the changes below:

When the camera zoom is set to any other value than one, if a dom element origin if set to anything other than 0, the final position of the DOM was incorrect.

The complete bug is described in #6817.

I traced this back to the DOMElementCSSRenderer.
After some trial and error, I realized the translation needed to be applied after camera multiplication and not at the beginning.

With this change, DOMElements are correctly positioned.

This closes #6817 and workadventure/workadventure#3936 (where you can see a video of the issue in action)

Note: I very much suspect the same error happens in the "if" clause, if a parent matrix is set. However, I don't know how to test this. Any help is welcome to help me test this out.

When the camera zoom is set to any other value than one, if a dom element origin
if set to anything other than 0, the final position of the DOM was incorrect.

I traced this back to the DOMElementCSSRenderer.
After some trial and error, I realized the translation needed to be applied after camera multiplication
and not at the beginning.

With this change, DOMElements are correctly positioned.
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 this pull request may close these issues.

DomElement position is not kept correctly in the scene when a camera zooms out
1 participant