mirror of
https://github.com/penpot/penpot.git
synced 2025-05-21 10:06:11 +02:00
🐛 Preserve added or removed shapes on a component normal update
This commit is contained in:
parent
1ce68cb1cf
commit
0cfb66ae16
1 changed files with 21 additions and 11 deletions
|
@ -541,18 +541,24 @@
|
||||||
(:shapes shape-master))
|
(:shapes shape-master))
|
||||||
|
|
||||||
only-inst (fn [child-inst]
|
only-inst (fn [child-inst]
|
||||||
|
(when-not (and omit-touched?
|
||||||
|
(contains? (:touched shape-inst)
|
||||||
|
:shapes-group))
|
||||||
(remove-shape child-inst
|
(remove-shape child-inst
|
||||||
container
|
container
|
||||||
omit-touched?))
|
omit-touched?)))
|
||||||
|
|
||||||
only-master (fn [child-master]
|
only-master (fn [child-master]
|
||||||
|
(when-not (and omit-touched?
|
||||||
|
(contains? (:touched shape-inst)
|
||||||
|
:shapes-group))
|
||||||
(add-shape-to-instance child-master
|
(add-shape-to-instance child-master
|
||||||
component
|
component
|
||||||
container
|
container
|
||||||
root-inst
|
root-inst
|
||||||
root-master
|
root-master
|
||||||
omit-touched?
|
omit-touched?
|
||||||
set-remote-synced?))
|
set-remote-synced?)))
|
||||||
|
|
||||||
both (fn [child-inst child-master]
|
both (fn [child-inst child-master]
|
||||||
(let [sub-root? (and (:component-id shape-inst)
|
(let [sub-root? (and (:component-id shape-inst)
|
||||||
|
@ -935,7 +941,11 @@
|
||||||
container
|
container
|
||||||
{:type :del-obj
|
{:type :del-obj
|
||||||
:id (:id shape)
|
:id (:id shape)
|
||||||
:ignore-touched true})]
|
:ignore-touched true})
|
||||||
|
(make-change
|
||||||
|
container
|
||||||
|
{:type :reg-objects
|
||||||
|
:shapes (vec parents)})]
|
||||||
|
|
||||||
add-change (fn [id]
|
add-change (fn [id]
|
||||||
(let [shape' (get objects id)]
|
(let [shape' (get objects id)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue