Skip to content

Rotation of groups is incorrect in HTML #155

Closed

Description

@mimshwright

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

Activity

  1. mimshwright commented on Jan 12, 2025

    @mimshwright
    ContributorAuthor

    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.

  2. bernaferrari commented on Jan 15, 2025

    @bernaferrari
    Owner

    This is one of the confusing things in Figma. I think I've done that that subtraction in the past, not sure why it came back, feel free to send a PR.

  3. bernaferrari commented on Mar 13, 2025

    @bernaferrari
    Owner

    Should be working now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions