mirror of
https://github.com/penpot/penpot.git
synced 2025-05-23 04:36:12 +02: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
|
(defn start-edition-mode
|
||||||
[id]
|
[id]
|
||||||
{:pre [(uuid? id)]}
|
{:pre [(uuid? id)]}
|
||||||
(println "start-edition-mode" id)
|
|
||||||
(StartEditionMode. id))
|
(StartEditionMode. id))
|
||||||
|
|
||||||
;; --- Events (implicit) (for selected)
|
;; --- Events (implicit) (for selected)
|
||||||
|
|
|
@ -138,7 +138,14 @@
|
||||||
zoom (or (:zoom workspace) 1)]
|
zoom (or (:zoom workspace) 1)]
|
||||||
(letfn [(on-mouse-down [event]
|
(letfn [(on-mouse-down [event]
|
||||||
(dom/stop-propagation 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)
|
(if (:drawing workspace)
|
||||||
(rlocks/acquire! :ui/draw)
|
(rlocks/acquire! :ui/draw)
|
||||||
(rlocks/acquire! :ui/selrect)))
|
(rlocks/acquire! :ui/selrect)))
|
||||||
|
|
|
@ -92,11 +92,12 @@
|
||||||
"Function executed when the selection rect
|
"Function executed when the selection rect
|
||||||
interaction is terminated."
|
interaction is terminated."
|
||||||
[]
|
[]
|
||||||
(rs/emit! (-> (selrect->rect @position)
|
(let [rect (-> (selrect->rect @position)
|
||||||
(translate-to-canvas)
|
(translate-to-canvas))]
|
||||||
(uds/select-shapes)))
|
(rs/emit! (uds/deselect-all)
|
||||||
(rlocks/release! :ui/selrect)
|
(uds/select-shapes rect))
|
||||||
(reset! position nil))
|
(rlocks/release! :ui/selrect)
|
||||||
|
(reset! position nil)))
|
||||||
|
|
||||||
(defn- on-start
|
(defn- on-start
|
||||||
"Function execution when selrect action is started."
|
"Function execution when selrect action is started."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue