mirror of
https://github.com/penpot/penpot.git
synced 2025-07-24 22:47:14 +02:00
♻️ Refactor copy&paste and duplicate shape.
This commit is contained in:
parent
63f43d917b
commit
cd72860ea0
2 changed files with 150 additions and 192 deletions
|
@ -209,16 +209,16 @@
|
|||
(contains? objects frame-id))
|
||||
(let [obj (assoc obj
|
||||
:frame-id frame-id
|
||||
:parent-id parent-id
|
||||
:id id)]
|
||||
(-> data
|
||||
(update :objects assoc id obj)
|
||||
(update-in [:objects parent-id :shapes]
|
||||
(fn [shapes]
|
||||
(cond
|
||||
(some #{id} shapes) shapes
|
||||
(nil? index) (conj shapes id)
|
||||
:else (insert-at-index shapes index [id])))))))))
|
||||
(let [shapes (or shapes [])]
|
||||
(cond
|
||||
(some #{id} shapes) shapes
|
||||
(nil? index) (conj shapes id)
|
||||
:else (insert-at-index shapes index [id]))))))))))
|
||||
|
||||
(defmethod process-change :mod-obj
|
||||
[data {:keys [id operations] :as change}]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue