mirror of
https://github.com/penpot/penpot.git
synced 2026-11-21 01:22:01 +00:00
A variant switch carries a copy child's rotation, with the old copy's transform, and each of its flips as separate attributes, each only where both variants agree on it. When the variants agreed on a flip but not on the turn, the flip flag carried while the transform and the corners stayed the new copy's; when they agreed on the turn but not on a flip, the old transform replaced the new variant's flip. Either way the stored rotation and flips no longer described the transform. When the switch carries a turn or a flip, it now gives the child the transform and the corners that the resulting turn and flips compose, the turn before or after the flips as is nearer the old copy's axes. Benchmark (scripts/bench-components, ms, lower 2.5% quantile): | :world | :baseline | :now | :mean | :ratio | |------------------------------------+-----------+---------+---------+--------| | deepest-edit-through-three-levels | 35.215 | 22.732 | 23.882 | 0.65 | | edit-through-a-chain-of-dependents | 68.931 | 46.7 | 49.116 | 0.68 | | library-update-into-copies | 83.083 | 53.926 | 57.074 | 0.65 | | main-edit-among-many-shapes | 4.837 | 3.051 | 3.358 | 0.63 | | main-edit-into-10-copies | 1.79 | 1.147 | 1.188 | 0.64 | | main-edit-into-100-copies | 15.415 | 11.482 | 12.261 | 0.74 | | main-edit-into-1000-copies | 153.086 | 114.523 | 124.586 | 0.75 | | variant-switch-into-copies | 32.052 | 24.252 | 25.701 | 0.76 | AI-assisted-by: claude-opus-5-5