🐛 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)) (: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)]