mirror of
https://github.com/penpot/penpot.git
synced 2025-01-07 15:39:42 -05:00
Group selected items in svg:g.
This commit is contained in:
parent
7a71b088f4
commit
95a1bb80df
1 changed files with 9 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue