0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-04 13:29:14 -05:00

🐛 Fixes problem on shape creation

This commit is contained in:
alonso.torres 2021-05-17 11:34:39 +02:00
parent 93d8c171be
commit ea22f3f81c
3 changed files with 8 additions and 4 deletions

View file

@ -28,7 +28,6 @@
(watch [_ state stream] (watch [_ state stream]
(let [shape (get-in state [:workspace-drawing :object])] (let [shape (get-in state [:workspace-drawing :object])]
(rx/concat (rx/concat
(rx/of clear-drawing)
(when (:initialized? shape) (when (:initialized? shape)
(let [page-id (:current-page-id state) (let [page-id (:current-page-id state)
shape-click-width (case (:type shape) shape-click-width (case (:type shape)
@ -65,4 +64,8 @@
:page-id page-id :page-id page-id
:rect (:selrect shape)}) :rect (:selrect shape)})
(rx/map #(dwc/move-shapes-into-frame (:id shape) %))) (rx/map #(dwc/move-shapes-into-frame (:id shape) %)))
(rx/empty)))))))))) (rx/empty)))))
;; Delay so the mouse event can read the drawing state
(->> (rx/of clear-drawing)
(rx/delay 0)))))))

View file

@ -142,7 +142,7 @@
(not selected?) (not selected?)
(not edition) (not edition)
(not drawing-path?) (not drawing-path?)
(not (#{:comments :path} drawing-tool))) (not drawing-tool))
(st/emit! (dw/select-shape (:id @hover))))))))) (st/emit! (dw/select-shape (:id @hover)))))))))
(defn on-double-click (defn on-double-click

View file

@ -99,7 +99,8 @@
(timers/schedule (timers/schedule
(fn [] (fn []
(st/emit! (dwc/update-shapes [@shape-id] (st/emit! (dwc/update-shapes [@shape-id]
#(assoc % :thumbnail data))) #(assoc % :thumbnail data)
{:save-undo? false}))
(rx/push! next :next))))) (rx/push! next :next)))))
on-frame-not-found on-frame-not-found