0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-03 21:09:00 -05:00

Deactivate path edition mode on mouse down out of area.

This commit is contained in:
Andrey Antukh 2016-08-28 10:13:44 +03:00
parent ddae77db9d
commit c17f9da243
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95
3 changed files with 14 additions and 7 deletions

View file

@ -434,7 +434,6 @@
(defn start-edition-mode
[id]
{:pre [(uuid? id)]}
(println "start-edition-mode" id)
(StartEditionMode. id))
;; --- Events (implicit) (for selected)

View file

@ -138,7 +138,14 @@
zoom (or (:zoom workspace) 1)]
(letfn [(on-mouse-down [event]
(dom/stop-propagation event)
(rx/push! wb/events-b [:mouse/down])
(when (seq (:selected workspace))
(rs/emit! (uds/deselect-all)))
(let [opts {:shift? (kbd/shift? event)
:ctrl? (kbd/ctrl? event)}]
(rx/push! wb/events-b [:mouse/down opts]))
(if (:drawing workspace)
(rlocks/acquire! :ui/draw)
(rlocks/acquire! :ui/selrect)))

View file

@ -92,11 +92,12 @@
"Function executed when the selection rect
interaction is terminated."
[]
(rs/emit! (-> (selrect->rect @position)
(translate-to-canvas)
(uds/select-shapes)))
(rlocks/release! :ui/selrect)
(reset! position nil))
(let [rect (-> (selrect->rect @position)
(translate-to-canvas))]
(rs/emit! (uds/deselect-all)
(uds/select-shapes rect))
(rlocks/release! :ui/selrect)
(reset! position nil)))
(defn- on-start
"Function execution when selrect action is started."