0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-19 05:15:44 -05:00

Merge pull request #13 from uxbox/not-deselect-tool-on-draw

Not deselect tool on draw and deselect tool on esc
This commit is contained in:
Andrey Antukh 2016-04-15 19:09:27 +03:00
commit 6571c29c1d
2 changed files with 5 additions and 5 deletions

View file

@ -320,7 +320,9 @@
(reify (reify
rs/UpdateEvent rs/UpdateEvent
(-apply-update [_ state] (-apply-update [_ state]
(assoc-in state [:workspace :selected] #{})))) (-> state
(assoc-in [:workspace :selected] #{})
(assoc-in [:workspace :drawing] nil)))))
(defn group-selected (defn group-selected
[] []

View file

@ -89,8 +89,7 @@
(let [{:keys [x y]} (gpt/divide @wb/mouse-canvas-a @wb/zoom-l) (let [{:keys [x y]} (gpt/divide @wb/mouse-canvas-a @wb/zoom-l)
props {:x1 x :y1 y :x2 (+ x 100) :y2 (+ y 100)} props {:x1 x :y1 y :x2 (+ x 100) :y2 (+ y 100)}
shape (ush/initialize shape props)] shape (ush/initialize shape props)]
(rs/emit! (uds/add-shape shape) (rs/emit! (uds/add-shape shape))))
(udw/select-for-drawing nil))))
(defn- initialize-shape-drawing (defn- initialize-shape-drawing
"A drawing handler for generic shapes such as rect, circle, text, etc." "A drawing handler for generic shapes such as rect, circle, text, etc."
@ -103,8 +102,7 @@
(let [shape @drawing-shape (let [shape @drawing-shape
shpos @drawing-position shpos @drawing-position
shape (ush/resize shape shpos)] shape (ush/resize shape shpos)]
(rs/emit! (uds/add-shape shape) (rs/emit! (uds/add-shape shape))
(udw/select-for-drawing nil))
(reset! drawing-position nil) (reset! drawing-position nil)
(reset! drawing-shape nil)))] (reset! drawing-shape nil)))]