mirror of
https://github.com/penpot/penpot.git
synced 2025-02-03 21:09:00 -05:00
🐛 Fix problem with non existing children
This commit is contained in:
parent
beaea73276
commit
b9b287d3b2
2 changed files with 35 additions and 34 deletions
|
@ -317,6 +317,7 @@
|
||||||
|
|
||||||
(defn- prepare-duplicate-shape-change
|
(defn- prepare-duplicate-shape-change
|
||||||
[objects page-id names obj delta frame-id parent-id]
|
[objects page-id names obj delta frame-id parent-id]
|
||||||
|
(when (some? obj)
|
||||||
(let [id (uuid/next)
|
(let [id (uuid/next)
|
||||||
name (dwc/generate-unique-name names (:name obj))
|
name (dwc/generate-unique-name names (:name obj))
|
||||||
renamed-obj (assoc obj :id id :name name)
|
renamed-obj (assoc obj :id id :name name)
|
||||||
|
@ -350,7 +351,7 @@
|
||||||
:parent-id parent-id
|
:parent-id parent-id
|
||||||
:ignore-touched true
|
:ignore-touched true
|
||||||
:obj (dissoc reframed-obj :shapes)}]
|
:obj (dissoc reframed-obj :shapes)}]
|
||||||
children-changes)))
|
children-changes))))
|
||||||
|
|
||||||
(defn- prepare-duplicate-frame-change
|
(defn- prepare-duplicate-frame-change
|
||||||
[objects page-id names obj delta]
|
[objects page-id names obj delta]
|
||||||
|
@ -363,7 +364,7 @@
|
||||||
(assoc :id frame-id)
|
(assoc :id frame-id)
|
||||||
(assoc :name frame-name)
|
(assoc :name frame-name)
|
||||||
(assoc :frame-id uuid/zero)
|
(assoc :frame-id uuid/zero)
|
||||||
(dissoc :shapes)
|
(assoc :shapes [])
|
||||||
(geom/move delta))
|
(geom/move delta))
|
||||||
|
|
||||||
fch {:type :add-obj
|
fch {:type :add-obj
|
||||||
|
|
|
@ -138,7 +138,7 @@
|
||||||
(gpt/negate)
|
(gpt/negate)
|
||||||
(gmt/translate-matrix))
|
(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))
|
objects (->> (d/concat [frame-id] (cp/get-children frame-id objects))
|
||||||
(reduce update-fn objects))
|
(reduce update-fn objects))
|
||||||
|
|
Loading…
Add table
Reference in a new issue