mirror of
https://github.com/penpot/penpot.git
synced 2025-02-26 00:36:12 -05:00
🐛 Fix toolbar hidden after unfinished path
This commit is contained in:
parent
ff72a9ce70
commit
e6fcb418b1
3 changed files with 11 additions and 6 deletions
|
@ -276,7 +276,8 @@
|
|||
(cond-> (some? drop-index)
|
||||
(with-meta {:index drop-index})))))))))
|
||||
|
||||
(defn handle-new-shape-result [shape-id]
|
||||
(defn handle-new-shape-result
|
||||
[shape-id]
|
||||
(ptk/reify ::handle-new-shape-result
|
||||
ptk/UpdateEvent
|
||||
(update [_ state]
|
||||
|
@ -293,7 +294,7 @@
|
|||
ptk/WatchEvent
|
||||
(watch [_ state _]
|
||||
(let [content (get-in state [:workspace-drawing :object :content] [])]
|
||||
(if (seq content)
|
||||
(if (and (seq content) (> (count content) 1))
|
||||
(rx/of (setup-frame)
|
||||
(dwdc/handle-finish-drawing)
|
||||
(dwe/start-edition-mode shape-id)
|
||||
|
|
|
@ -319,9 +319,9 @@
|
|||
(= (ptk/type %) ::start-path-edit))))
|
||||
interrupt (->> stream (rx/filter #(= % :interrupt)) (rx/take 1))]
|
||||
(rx/concat
|
||||
(rx/of (dwc/hide-toolbar))
|
||||
(rx/of (undo/start-path-undo))
|
||||
(rx/of (drawing/change-edit-mode mode))
|
||||
(rx/of (dwc/hide-toolbar)
|
||||
(undo/start-path-undo)
|
||||
(drawing/change-edit-mode mode))
|
||||
(->> interrupt
|
||||
(rx/map #(stop-path-edit id))
|
||||
(rx/take-until stopper)))))))
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
(:require
|
||||
[app.main.data.shortcuts :as ds]
|
||||
[app.main.data.workspace :as dw]
|
||||
[app.main.data.workspace.common :as dwc]
|
||||
[app.main.data.workspace.path :as drp]
|
||||
[app.main.store :as st]
|
||||
[beicon.v2.core :as rx]
|
||||
|
@ -26,10 +27,13 @@
|
|||
;; Not interrupt when we're editing a path
|
||||
(let [edition-id (or (get-in state [:workspace-drawing :object :id])
|
||||
(get-in state [:workspace-local :edition]))
|
||||
content (get-in state [:workspace-drawing :object :content])
|
||||
path-edit-mode (get-in state [:workspace-local :edit-path edition-id :edit-mode])]
|
||||
(if-not (= :draw path-edit-mode)
|
||||
(rx/of :interrupt)
|
||||
(rx/empty))))))
|
||||
(if (<= (count content) 1)
|
||||
(rx/of (dwc/show-toolbar))
|
||||
(rx/empty)))))))
|
||||
|
||||
(def shortcuts
|
||||
{:move-nodes {:tooltip "M"
|
||||
|
|
Loading…
Add table
Reference in a new issue