0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-09 21:41:23 -05:00

🐛 Fix create new layers in component copy

This commit is contained in:
Alejandro Alonso 2025-02-05 12:31:40 +01:00 committed by Pablo Alba
parent 0b90722d5a
commit 8aae928796
2 changed files with 4 additions and 2 deletions

View file

@ -55,6 +55,7 @@ is a number of cores)
- Fix error when reseting stroke cap
- Fix problem with strokes not refreshing in Safari [Taiga #9040](https://tree.taiga.io/project/penpot/issue/9040)
- Fix problem with multiple color changes [Taiga #9631](https://tree.taiga.io/project/penpot/issue/9631)
- Fix create new layers in a component copy [Taiga #10037](https://tree.taiga.io/project/penpot/issue/10037)
- Fix problem in plugins with zoomIntoView [Plugins #189](https://github.com/penpot/penpot-plugins/issues/189)
- Fix problem in plugins with renaming components [Taiga #10060](https://tree.taiga.io/project/penpot/issue/10060)
- Added upload svg with images method [#5489](https://github.com/penpot/penpot/issues/5489)

View file

@ -535,10 +535,11 @@
(letfn [(get-frame [parent-id]
(if (cfh/frame-shape? objects parent-id) parent-id (get-in objects [parent-id :frame-id])))]
(let [parent (get objects parent-id)
;; We can always move the children to the parent they already have
;; We can always move the children to the parent they already have.
no-changes?
(->> children (every? #(= parent-id (:parent-id %))))]
(if (or no-changes? (not (invalid-structure-for-component? objects parent children pasting? libraries)))
;; In case no-changes is true we must ensure we are copy pasting the children in the same position
(if (or (and no-changes? (not pasting?)) (not (invalid-structure-for-component? objects parent children pasting? libraries)))
[parent-id (get-frame parent-id)]
(recur (:parent-id parent) objects children pasting? libraries))))))