This commit is contained in:
Andrés Moya
2023-06-22 11:32:31 +02:00
parent 0ae4988908
commit adc6af129c
2 changed files with 9 additions and 7 deletions

View File

@@ -43,7 +43,7 @@
[potok.core :as ptk])) [potok.core :as ptk]))
;; Change this to :info :debug or :trace to debug this module, or :warn to reset to default ;; Change this to :info :debug or :trace to debug this module, or :warn to reset to default
(log/set-level! :warn) (log/set-level! :debug)
(defn- log-changes (defn- log-changes
[changes file] [changes file]

View File

@@ -181,12 +181,14 @@
(not (nil? parent-id)) (not (nil? parent-id))
(assoc :parent-id parent-id)) (assoc :parent-id parent-id))
changes (cond-> (pcb/add-object changes first-shape {:ignore-touched true}) changes (as-> changes $
(some? old-id) (pcb/amend-last-change #(assoc % :old-id old-id))) ; on copy/paste old id is used later to reorder the paster layers (pcb/add-object $ first-shape {:ignore-touched true})
(cond-> $
changes (reduce #(pcb/add-object %1 %2 {:ignore-touched true}) (some? old-id)
changes (pcb/amend-last-change #(assoc % :old-id old-id))) ; on copy/paste old id is used later to reorder the paster layers
(rest new-shapes))] (reduce #(pcb/add-object %1 %2 {:ignore-touched true})
$
(rest new-shapes)))]
[new-shape changes]))) [new-shape changes])))