0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 16:00:19 -05:00

Group selected items in svg:g.

This commit is contained in:
Andrey Antukh 2015-12-30 01:37:43 +02:00
parent 7a71b088f4
commit 95a1bb80df

View file

@ -127,6 +127,9 @@
[]
(let [page (rum/react wb/page-state)
shapes (rum/react wb/shapes-state)
selected-ids (rum/react wb/selected-state)
selected (filter (comp selected-ids :id) shapes)
nonselected (filter (comp not selected-ids :id) shapes)
page-width (:width page)
page-height (:height page)]
(letfn [(on-mouse-down [event]
@ -146,8 +149,12 @@
(background)
(grid 1)
[:svg.page-layout {}
(for [item shapes]
(rum/with-key (shape item) (str (:id item))))]]))))
(for [item nonselected]
(rum/with-key (shape item) (str (:id item))))
(if (seq selected)
[:g.selected
(for [item selected]
(rum/with-key (shape item) (str (:id item))))])]]))))
(def canvas
(util/component