0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 08:50:57 -05:00

🐛 Fix problem with non existing children

This commit is contained in:
alonso.torres 2021-07-09 10:40:39 +02:00
parent beaea73276
commit b9b287d3b2
2 changed files with 35 additions and 34 deletions

View file

@ -317,6 +317,7 @@
(defn- prepare-duplicate-shape-change
[objects page-id names obj delta frame-id parent-id]
(when (some? obj)
(let [id (uuid/next)
name (dwc/generate-unique-name names (:name obj))
renamed-obj (assoc obj :id id :name name)
@ -350,7 +351,7 @@
:parent-id parent-id
:ignore-touched true
:obj (dissoc reframed-obj :shapes)}]
children-changes)))
children-changes))))
(defn- prepare-duplicate-frame-change
[objects page-id names obj delta]
@ -363,7 +364,7 @@
(assoc :id frame-id)
(assoc :name frame-name)
(assoc :frame-id uuid/zero)
(dissoc :shapes)
(assoc :shapes [])
(geom/move delta))
fch {:type :add-obj

View file

@ -138,7 +138,7 @@
(gpt/negate)
(gmt/translate-matrix))
update-fn #(assoc-in %1 [%2 :modifiers :displacement] modifier)
update-fn #(d/update-when %1 %2 assoc-in [:modifiers :displacement] modifier)
objects (->> (d/concat [frame-id] (cp/get-children frame-id objects))
(reduce update-fn objects))