mirror of
https://github.com/penpot/penpot.git
synced 2025-06-07 22:11:38 +02:00
🐛 Properly handle grouping from multiple frames.
This commit is contained in:
parent
861150ff46
commit
91c07d5573
1 changed files with 8 additions and 7 deletions
|
@ -1232,13 +1232,14 @@
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state stream]
|
(watch [_ state stream]
|
||||||
(let [id (uuid/next)
|
(let [id (uuid/next)
|
||||||
selected (get-in state [:workspace-local :selected])]
|
page-id (get-in state [:workspace-page :id])
|
||||||
(when (not-empty selected)
|
selected (get-in state [:workspace-local :selected])
|
||||||
(let [page-id (get-in state [:workspace-page :id])
|
objects (get-in state [:workspace-data page-id :objects])
|
||||||
objects (get-in state [:workspace-data page-id :objects])
|
items (->> selected
|
||||||
|
(map #(get objects %))
|
||||||
items (map #(get objects %) selected)
|
(filter #(not= :frame (:type %))))]
|
||||||
selrect (geom/selection-rect items)
|
(when (not-empty items)
|
||||||
|
(let [selrect (geom/selection-rect items)
|
||||||
frame-id (-> items first :frame-id)
|
frame-id (-> items first :frame-id)
|
||||||
parent-id (-> items first :parent-id)
|
parent-id (-> items first :parent-id)
|
||||||
group (-> (group-shape id frame-id selected selrect)
|
group (-> (group-shape id frame-id selected selrect)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue