mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 06:58:58 -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)
|
(let [page (rum/react wb/page-state)
|
||||||
shapes (rum/react wb/shapes-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-width (:width page)
|
||||||
page-height (:height page)]
|
page-height (:height page)]
|
||||||
(letfn [(on-mouse-down [event]
|
(letfn [(on-mouse-down [event]
|
||||||
|
@ -146,8 +149,12 @@
|
||||||
(background)
|
(background)
|
||||||
(grid 1)
|
(grid 1)
|
||||||
[:svg.page-layout {}
|
[:svg.page-layout {}
|
||||||
(for [item shapes]
|
(for [item nonselected]
|
||||||
(rum/with-key (shape item) (str (:id item))))]]))))
|
(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
|
(def canvas
|
||||||
(util/component
|
(util/component
|
||||||
|
|
Loading…
Add table
Reference in a new issue