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

Adapt canvas component for render the selrect.

This commit is contained in:
Andrey Antukh 2016-01-01 22:48:11 +02:00
parent 2a94efc4ef
commit d9c8e083a9

View file

@ -175,10 +175,13 @@
page-height (:height page)]
(letfn [(on-mouse-down [event]
(dom/stop-propagation event)
(rs/emit! (dw/deselect-all)))
(when-not (empty? selected-ids)
(rs/emit! (dw/deselect-all)))
(reset! wb/selrect-dragging? true))
(on-mouse-up [event]
(dom/stop-propagation event)
(reset! wb/shapes-dragging? false))]
(reset! wb/shapes-dragging? false)
(reset! wb/selrect-dragging? false))]
(html
[:svg.page-canvas {:x wb/document-start-x
:y wb/document-start-y
@ -192,14 +195,14 @@
[:svg.page-layout {}
(for [item nonselected]
(rum/with-key (shape item) (str (:id item))))
(cond
(= (count selected) 1)
(shape (first selected))
(> (count selected) 1)
(selected-shapes selected))]]))))
(selected-shapes selected))
(selrect)]]))))
(def canvas
(util/component