🐛 Fix problem with double click

This commit is contained in:
alonso.torres 2022-02-21 16:56:41 +01:00
parent 96facc5100
commit aed6a8a5ff
2 changed files with 16 additions and 11 deletions

View file

@ -186,19 +186,23 @@
(st/emit! (ms/->MouseEvent :double-click ctrl? shift? alt?))
(when (and (not drawing-path?) shape)
(cond frame?
(st/emit! (dw/select-shape id shift?))
;; Emit asynchronously so the double click to exit shapes won't break
(timers/schedule
#(when (and (not drawing-path?) shape)
(cond
frame?
(st/emit! (dw/select-shape id shift?))
(and group? (> (count @hover-ids) 1))
(let [selected (get objects (second @hover-ids))]
(reset! hover selected)
(reset! hover-ids (into [] (rest @hover-ids)))
(st/emit! (dw/select-shape (:id selected))))
(and group? (> (count @hover-ids) 1))
(let [selected (get objects (second @hover-ids))]
(reset! hover selected)
(reset! hover-ids (into [] (rest @hover-ids)))
(not= id edition)
(st/emit! (dw/select-shape id)
(dw/start-editing-selected))))))))
(st/emit! (dw/select-shape (:id selected))))
(not= id edition)
(st/emit! (dw/select-shape id)
(dw/start-editing-selected)))))))))
(defn on-context-menu
[hover hover-ids]