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

Rotation of groups is incorrect in HTML #155

Open
mimshwright opened this issue Jan 8, 2025 · 1 comment
Open

Rotation of groups is incorrect in HTML #155

mimshwright opened this issue Jan 8, 2025 · 1 comment

Comments

@mimshwright
Copy link
Contributor

mimshwright commented Jan 8, 2025

When a group has rotation it's incorrectly applied in the code. I've seen this behavior in HTML but not sure whether all code is affected.
Screenshot 2025-01-08 at 11 39 21

It appears that perhaps the rotation is applied to the group and also to the children of the group.
Screenshot 2025-01-08 at 11 39 43

The effects compound when there are are multiple groups or multiple rotations inside the groups.
Screenshot 2025-01-08 at 11 34 52

@mimshwright
Copy link
Contributor Author

mimshwright commented Jan 12, 2025

Seems this is how the nodes in the figma API are represented.

For some reason, a group with rotation also has rotated nodes.

  • group 1 - rotation 45°
    • child 1 - rotation 45°

if the child is also rotated 45° the effect is doubled

  • group 1 - rotation 45°
    • child 1 - rotation 90°

So seems like we need to subtract the rotation of the parent from the children.

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

No branches or pull requests

1 participant