mirror of
https://github.com/penpot/penpot.git
synced 2026-11-21 01:22:01 +00:00
🐛 Make kept copy children follow a parent the sync resizes
A sync gives an untouched copy shape the geometry of its main, and it carries the subtree of a shape it moves, turns or flips. A shape it only resizes, like a copy root that a layout had made wider, left its kept children where they were: a child the user moved, or a swapped one. The layout then grew the parent back and moved them through their constraints again, so a child with a right constraint drifted and one with a scale constraint grew on every sync. A resized shape now carries its subtree too, through the constraints of its children, as it already did when it was also turned. The sync tests of develop's swapped and moved children placement (the right and scale constraints of a filled card) cover it. Benchmark (scripts/bench-components, ms, lower 2.5% quantile): | world | baseline | now | ratio | |------------------------------------+----------+---------+-------| | deepest-edit-through-three-levels | 35.215 | 19.216 | 0.55 | | edit-through-a-chain-of-dependents | 68.931 | 40.478 | 0.59 | | library-update-into-copies | 83.083 | 45.274 | 0.54 | | main-edit-among-many-shapes | 4.837 | 2.131 | 0.44 | | main-edit-into-10-copies | 1.79 | 0.91 | 0.51 | | main-edit-into-100-copies | 15.415 | 8.947 | 0.58 | | main-edit-into-1000-copies | 153.086 | 88.109 | 0.58 | | variant-switch-into-copies | 32.052 | 21.369 | 0.67 | AI-assisted-by: claude-opus-5-5
This commit is contained in:
parent
ae0326d63f
commit
b64de794a2
@ -604,6 +604,7 @@
|
||||
(not (gpt/close? (gsh/shape->center before) (gsh/shape->center after))))
|
||||
changed? (and after
|
||||
(or moved?
|
||||
resized?
|
||||
(not (mth/close? (or (:rotation before) 0) (or (:rotation after) 0) 1e-10))
|
||||
(not= (boolean (:flip-x before)) (boolean (:flip-x after)))
|
||||
(not= (boolean (:flip-y before)) (boolean (:flip-y after)))))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user