Fix rendering of rotated nodes #244
Labels
❗ P1
Priority for next release
🟢 P2
Priority for next 2-3 releases
Type: Bug
Something isn't working
Type: Customer Issue
Many eyes on this issue
When a node in Figma is rotated and offset from its parent (meaning it has an x and/or y offset from its parent when not rotated), we often render the node incorrectly. Something incorrect happens in transform_flexbox.rs when setting the transform matrix.
In the stroke validation test https://www.figma.com/file/Z3ucY0wMAbIwZIa6mLEWIK/stroke-stuff?node-id=0%3A1&t=0Dq3abJhR4zpH060-1, the node from the Battleship doc breaks because the rect is rotated 90 degrees, offset from its parent, and has its constraints set to left-right + top-bottom. This causes the width/height of the frame to be calculated incorrectly.
A possible fix may be to undo any rotation set in the Figma file so that we get the x/y offset without any rotation, then set the transform matrix with the rotation in it. We may need to also add a translation to the rotation so that we rotate about the center, not the top left.
The text was updated successfully, but these errors were encountered: