mirror of
https://github.com/penpot/penpot.git
synced 2025-05-19 18:56:11 +02:00
🐛 Fix touched on adding shapes to a component copy and undo
This commit is contained in:
parent
d4fe810813
commit
d8121364ad
7 changed files with 41 additions and 10 deletions
|
@ -485,7 +485,8 @@
|
|||
(let [page (wsh/lookup-page state)
|
||||
libraries (wsh/get-libraries state)
|
||||
|
||||
changes (pcb/empty-changes it (:id page))
|
||||
changes (-> (pcb/empty-changes it (:id page))
|
||||
(pcb/with-objects (:objects page)))
|
||||
|
||||
[new-shape changes]
|
||||
(dwlh/generate-instantiate-component changes
|
||||
|
|
|
@ -228,6 +228,7 @@
|
|||
(assoc :parent-id parent-id))
|
||||
changes (-> (or changes (pcb/empty-changes it))
|
||||
(pcb/with-page page)
|
||||
(pcb/with-objects (:objects page))
|
||||
(pcb/with-library-data library-data))
|
||||
changes (cond-> (pcb/add-object changes first-shape {:ignore-touched true})
|
||||
(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
|
||||
|
|
|
@ -433,7 +433,7 @@
|
|||
(gsh/move delta)
|
||||
(d/update-when :interactions #(ctsi/remap-interactions % ids-map objects)))
|
||||
|
||||
changes (-> (pcb/add-object changes new-obj {:ignore-touched true})
|
||||
changes (-> (pcb/add-object changes new-obj)
|
||||
(pcb/amend-last-change #(assoc % :old-id (:id obj))))
|
||||
|
||||
changes (cond-> changes
|
||||
|
|
|
@ -108,7 +108,8 @@
|
|||
objects (wsh/lookup-page-objects state page-id)
|
||||
selected (wsh/lookup-selected state)
|
||||
|
||||
changes (pcb/empty-changes it page-id)
|
||||
changes (-> (pcb/empty-changes it page-id)
|
||||
(pcb/with-objects objects))
|
||||
|
||||
[shape changes]
|
||||
(prepare-add-shape changes attrs objects selected)
|
||||
|
@ -433,7 +434,8 @@
|
|||
selected (wsh/lookup-selected state)
|
||||
selected (cph/clean-loops objects selected)
|
||||
|
||||
changes (pcb/empty-changes it page-id)
|
||||
changes (-> (pcb/empty-changes it page-id)
|
||||
(pcb/with-objects objects))
|
||||
|
||||
[frame-shape changes]
|
||||
(prepare-create-artboard-from-selection changes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue