0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-03 04:49:03 -05:00

🐛 Fix ungrouping detach components

This commit is contained in:
Pablo Alba 2024-04-25 19:50:22 +02:00 committed by Andrés Moya
parent e0fe7181f1
commit 6901acb37e

View file

@ -143,18 +143,12 @@
(map-indexed vector) (map-indexed vector)
(filter #(#{(:id group)} (second %))) (filter #(#{(:id group)} (second %)))
(ffirst) (ffirst)
inc) inc)]
;; Shapes that are in a component (including root) must be detached,
;; because cannot be easyly synchronized back to the main component.
shapes-to-detach (filter ctk/in-component-copy?
(cfh/get-children-with-self objects (:id group)))]
(-> (pcb/empty-changes it page-id) (-> (pcb/empty-changes it page-id)
(pcb/with-objects objects) (pcb/with-objects objects)
(pcb/change-parent parent-id children index-in-parent) (pcb/change-parent parent-id children index-in-parent)
(pcb/remove-objects [(:id group)]) (pcb/remove-objects [(:id group)]))))
(pcb/update-shapes (map :id shapes-to-detach) ctk/detach-shape))))
(defn remove-frame-changes (defn remove-frame-changes
[it page-id frame objects] [it page-id frame objects]