0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 00:10:11 -05:00

🐛 Properly handle grouping from multiple frames.

This commit is contained in:
Andrey Antukh 2020-06-12 12:20:25 +02:00 committed by Andrés Moya
parent 861150ff46
commit 91c07d5573

View file

@ -1232,13 +1232,14 @@
ptk/WatchEvent
(watch [_ state stream]
(let [id (uuid/next)
selected (get-in state [:workspace-local :selected])]
(when (not-empty selected)
(let [page-id (get-in state [:workspace-page :id])
objects (get-in state [:workspace-data page-id :objects])
items (map #(get objects %) selected)
selrect (geom/selection-rect items)
page-id (get-in state [:workspace-page :id])
selected (get-in state [:workspace-local :selected])
objects (get-in state [:workspace-data page-id :objects])
items (->> selected
(map #(get objects %))
(filter #(not= :frame (:type %))))]
(when (not-empty items)
(let [selrect (geom/selection-rect items)
frame-id (-> items first :frame-id)
parent-id (-> items first :parent-id)
group (-> (group-shape id frame-id selected selrect)