mirror of
https://github.com/penpot/penpot.git
synced 2026-11-21 17:50:38 +00:00
When a copy resizes or turns a main that fills or hugs in a layout, the update main pushed the size, the layout gave the main its own size back, and the copy followed and lost its size. When the copy shape authors its geometry, the push now fixes each fill or auto axis it changes, on both axes when it turns the shape in its parent, as a resize of a fill child does in the editor. The main and the copy take the same sizing; a shape that is not a layout drops it, which leaves it fixed like its copies. A sizing the copy authors is pushed as it is. A shape the copy does not resize, such as a fill child that a copy's grid padding resizes, keeps its sizing: the main's layout gives it the same size. Tests: updating-a-fill-main-from-a-resized-copy-fixes-the-main-size, updating-a-turned-fill-main-from-its-copy-fixes-the-main-size (the variant gate programs of round 11, seeds 252148030 and 333977410), updating-a-main-with-a-turned-copy-keeps-the-fill-of-its-laid-out-children and updating-a-main-whose-copy-padding-resized-a-fill-child-keeps-its-fill (round 12, seed 333977410). Benchmark (scripts/bench-components, ms, lower 2.5% quantile): | :world | :baseline | :now | :mean | :ratio | |------------------------------------+-----------+--------+---------+--------| | deepest-edit-through-three-levels | 35.215 | 20.989 | 21.843 | 0.6 | | edit-through-a-chain-of-dependents | 68.931 | 42.083 | 43.11 | 0.61 | | library-update-into-copies | 83.083 | 54.201 | 55.537 | 0.65 | | main-edit-among-many-shapes | 4.837 | 2.43 | 2.533 | 0.5 | | main-edit-into-10-copies | 1.79 | 1.047 | 1.117 | 0.58 | | main-edit-into-100-copies | 15.415 | 11.084 | 11.219 | 0.72 | | main-edit-into-1000-copies | 153.086 | 101.1 | 110.921 | 0.66 | | variant-switch-into-copies | 32.052 | 22.903 | 23.542 | 0.71 | AI-assisted-by: claude-opus-5-5