mirror of
https://github.com/penpot/penpot.git
synced 2026-11-21 01:22:01 +00:00
🐛 Unmask copies without overriding them when a main loses its mask
Removing the mask shape of a masked group in a main unmasks the group. The deletion reaches the copies through the same deletion, which ignores touched groups, but the step that unmasks a group that lost its mask did not, so every copy's group came out unmasked and marked as overriding its mask. The unmask follows the deletion's ignore-touched option. Test: removing-the-mask-of-a-main-unmasks-its-copies-without-overriding-them. Benchmark (alone, shared with the next commit): | :world | :baseline | :now | :mean | :ratio | |------------------------------------+-----------+---------+---------+--------| | deepest-edit-through-three-levels | 35.215 | 21.715 | 24.396 | 0.62 | | edit-through-a-chain-of-dependents | 68.931 | 48.192 | 53.222 | 0.7 | | library-update-into-copies | 83.083 | 50.508 | 52.972 | 0.61 | | main-edit-among-many-shapes | 4.837 | 2.345 | 2.775 | 0.48 | | main-edit-into-10-copies | 1.79 | 1.172 | 1.479 | 0.65 | | main-edit-into-100-copies | 15.415 | 11.582 | 13.079 | 0.75 | | main-edit-into-1000-copies | 153.086 | 102.539 | 133.903 | 0.67 | | variant-switch-into-copies | 32.052 | 22.204 | 24.303 | 0.69 | AI-assisted-by: claude-opus-5-5
This commit is contained in:
parent
c9683d7398
commit
f6d4e5dcd5
@ -484,9 +484,11 @@
|
||||
shape))
|
||||
{:ignore-touched true :with-objects? true})
|
||||
(pcb/resize-parents all-parents)
|
||||
;; a copy's group unmasked as its main's is no override
|
||||
(pcb/update-shapes groups-to-unmask
|
||||
(fn [shape]
|
||||
(assoc shape :masked-group false)))
|
||||
(assoc shape :masked-group false))
|
||||
{:ignore-touched (boolean ignore-touched)})
|
||||
(pcb/update-shapes (map :id interacting-shapes)
|
||||
(fn [shape]
|
||||
(d/update-when shape :interactions
|
||||
|
||||
@ -2514,6 +2514,11 @@
|
||||
:ops [[:delete 11] [:detach 5] [:swap 10] [:add-child] [:structure 0 6 3] [:nest 11]
|
||||
[:transform 2 0 0 7] [:detach 13]]}))))
|
||||
|
||||
(t/deftest removing-the-mask-of-a-main-unmasks-its-copies-without-overriding-them
|
||||
(t/is (map? (cg/run {:world [1 0 {:variants true :rich-variants true :text false :layout :grid
|
||||
:layout-copies false :layout-children false}]
|
||||
:ops [[:structure 1 1 1] [:remove-child 1]]}))))
|
||||
|
||||
(t/deftest settling-a-bool-in-a-grid-copy-twice-keeps-its-shapes-in-place
|
||||
(t/is (map? (cg/run {:world [3 0 {:variants true :rich-variants true :text true :layout :grid
|
||||
:layout-copies true :layout-children true}]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user