0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 07:29:08 -05:00

🐛 Preserve added or removed shapes on a component normal update

This commit is contained in:
Andrés Moya 2021-01-26 13:50:51 +01:00 committed by Andrey Antukh
parent 1ce68cb1cf
commit 0cfb66ae16

View file

@ -541,18 +541,24 @@
(:shapes shape-master))
only-inst (fn [child-inst]
(remove-shape child-inst
container
omit-touched?))
(when-not (and omit-touched?
(contains? (:touched shape-inst)
:shapes-group))
(remove-shape child-inst
container
omit-touched?)))
only-master (fn [child-master]
(add-shape-to-instance child-master
component
container
root-inst
root-master
omit-touched?
set-remote-synced?))
(when-not (and omit-touched?
(contains? (:touched shape-inst)
:shapes-group))
(add-shape-to-instance child-master
component
container
root-inst
root-master
omit-touched?
set-remote-synced?)))
both (fn [child-inst child-master]
(let [sub-root? (and (:component-id shape-inst)
@ -935,7 +941,11 @@
container
{:type :del-obj
:id (:id shape)
:ignore-touched true})]
:ignore-touched true})
(make-change
container
{:type :reg-objects
:shapes (vec parents)})]
add-change (fn [id]
(let [shape' (get objects id)]