mirror of
https://github.com/penpot/penpot.git
synced 2026-11-21 09:42:01 +00:00
A sync places a swapped copy head where the shape it replaces would be. When both are turned alike, it lines up their first corners; otherwise it lines up the corners of their unrotated rectangles. Two transforms counted as turned alike only when their matrices were close, and the transform of a head at the 0.01 px minimum size scales its axes by its rounding (0.706 for 0.707). So a tiny head in a turned copy was placed by the unrotated corner of a 100 px board, and its selrect ended 50 px away from its own corners. The placement compares the directions of the transforms' axes, without their lengths, as the sync of a parent's descendants already does. Benchmark (scripts/bench-components, ms, lower 2.5% quantile): | world | baseline | now | ratio | |------------------------------------+----------+---------+-------| | deepest-edit-through-three-levels | 35.215 | 20.375 | 0.58 | | edit-through-a-chain-of-dependents | 68.931 | 39.744 | 0.58 | | library-update-into-copies | 83.083 | 49.053 | 0.59 | | main-edit-among-many-shapes | 4.837 | 2.269 | 0.47 | | main-edit-into-10-copies | 1.79 | 1.082 | 0.60 | | main-edit-into-100-copies | 15.415 | 9.911 | 0.64 | | main-edit-into-1000-copies | 153.086 | 95.772 | 0.63 | | variant-switch-into-copies | 32.052 | 21.539 | 0.67 | AI-assisted-by: claude-opus-5-5