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:
parent
ddae77db9d
commit
c17f9da243
3 changed files with 14 additions and 7 deletions
|
@ -434,7 +434,6 @@
|
|||
(defn start-edition-mode
|
||||
[id]
|
||||
{:pre [(uuid? id)]}
|
||||
(println "start-edition-mode" id)
|
||||
(StartEditionMode. id))
|
||||
|
||||
;; --- Events (implicit) (for selected)
|
||||
|
|
|
@ -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)))
|
||||
|
|
|
@ -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."
|
||||
|
|
Loading…
Add table
Reference in a new issue