🐛 Fix when changing order on main+flex, the copies are badly updated

This commit is contained in:
Pablo Alba 2023-11-30 19:34:59 +01:00 committed by Andrés Moya
parent 76ec610d44
commit 3e965c96e7
3 changed files with 13 additions and 11 deletions

View file

@ -946,16 +946,16 @@
changes (pcb/concat-changes library-changes file-changes)
find-shape (fn [data]
(for [page-id [(:page-id data)]
id (:shapes data)]
extract-shapes (fn [change]
(for [page-id [(:page-id change)]
id (:shapes change)]
(-> (get-in state [:workspace-data :pages-index page-id :objects id])
(assoc :page-id page-id))))
updated-copies (->> changes
:redo-changes
(filter #(= (:type %) :reg-objects))
(mapcat find-shape)
(mapcat extract-shapes)
(filter ctk/instance-head?)
distinct)]

View file

@ -1141,14 +1141,16 @@
:parent-id (:parent-id shape)
:shapes [(:id shape)]
:index index-after
:ignore-touched true}))
:ignore-touched true
:syncing true}))
(update :undo-changes conj (make-change
container
{:type :mov-objects
:parent-id (:parent-id shape)
:shapes [(:id shape)]
:index index-before
:ignore-touched true})))]
:ignore-touched true
:syncing true})))]
(if (and (cfh/touched-group? parent :shapes-group) omit-touched?)
changes