0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-13 16:21:57 -05:00

Dont allow draw empty shapes.

This commit is contained in:
Andrey Antukh 2017-02-22 21:02:40 +01:00
parent 4a9d0710a4
commit 3940995e21
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -229,9 +229,9 @@
(rx/take 1)))
start? (volatile! true)
mouse (->> streams/viewport-mouse-position
(rx/take-until stoper)
(rx/mapcat conditional-align)
(rx/map translate-to-canvas)
(rx/take-until stoper)
(rx/with-latest vector streams/mouse-position-ctrl))]
(letfn [(on-position [[point ctrl?]]
@ -242,7 +242,9 @@
(st/emit! (update-drawing (assoc point :lock ctrl?)))))
(on-finish []
(st/emit! (finish-drawing)))]
(if @start?
(st/emit! ::uev/interrupt)
(st/emit! (finish-drawing))))]
(rx/subscribe mouse on-position nil on-finish))))
(defn- on-init-draw-icon