0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-25 07:58:49 -05:00

Render selrect for shapes that are not direct descendents of page.

Shapes that forms part of one group or subgroup also can
be selected.
This commit is contained in:
Andrey Antukh 2016-01-20 22:46:33 +02:00
parent e353d67b02
commit eabee221b6

View file

@ -128,7 +128,8 @@
xf (comp
(map #(get shapes-by-id %))
(remove :hidden))
shapes (sequence xf (:shapes page))
shapes (->> (vals shapes-by-id)
(filter #(= (:page %) id)))
shapes-selected (filter (comp workspace-selected :id) shapes)
shapes-notselected (filter (comp not workspace-selected :id) shapes)]
(html
@ -142,17 +143,9 @@
[:svg.page-layout {}
(shapes-selrect shapes-selected)
[:g.main {}
(for [item shapes]
(for [item (sequence xf (:shapes page))]
(-> (shape item workspace-selected)
(rum/with-key (str (:id item)))))
#_(cond
(= (count shapes-selected) 1)
(let [item (first shapes-selected)]
(selected-shape item workspace-selected))
(> (count shapes-selected) 1)
(selected-shapes shapes-selected))
(mouse-selrect)]]])))
(def canvas