mirror of
https://github.com/penpot/penpot.git
synced 2025-07-13 22:57:53 +02:00
Merge pull request #6752 from penpot/niwinz-staging-path-editor-fixes
🐛 Fix incorrect path tool handling on shapes not coerced to path
This commit is contained in:
commit
e1ce7ec787
2 changed files with 6 additions and 12 deletions
|
@ -304,11 +304,8 @@
|
||||||
(ptk/reify ::handle-drawing-end
|
(ptk/reify ::handle-drawing-end
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
(let [content (dm/get-in state [:workspace-drawing :object :content])]
|
(let [content (some-> (dm/get-in state [:workspace-drawing :object :content])
|
||||||
|
(path/check-path-content))]
|
||||||
(assert (path/check-path-content content)
|
|
||||||
"expected valid path content instance")
|
|
||||||
|
|
||||||
(if (> (count content) 1)
|
(if (> (count content) 1)
|
||||||
(assoc-in state [:workspace-drawing :object :initialized?] true)
|
(assoc-in state [:workspace-drawing :object :initialized?] true)
|
||||||
state)))
|
state)))
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
(ns app.main.data.workspace.path.tools
|
(ns app.main.data.workspace.path.tools
|
||||||
(:require
|
(:require
|
||||||
[app.common.data.macros :as dm]
|
[app.common.data.macros :as dm]
|
||||||
[app.common.files.helpers :as cfh]
|
|
||||||
[app.common.types.path :as path]
|
[app.common.types.path :as path]
|
||||||
[app.common.types.path.segment :as path.segment]
|
[app.common.types.path.segment :as path.segment]
|
||||||
[app.main.data.changes :as dch]
|
[app.main.data.changes :as dch]
|
||||||
|
@ -48,12 +47,10 @@
|
||||||
(changes/generate-path-changes it objects page-id shape (:content shape) new-content)]
|
(changes/generate-path-changes it objects page-id shape (:content shape) new-content)]
|
||||||
|
|
||||||
(rx/concat
|
(rx/concat
|
||||||
(if (cfh/path-shape? shape)
|
(rx/of (dwsh/update-shapes [id] path/convert-to-path)
|
||||||
(rx/empty)
|
(dch/commit-changes changes))
|
||||||
(rx/of (dwsh/update-shapes [id] path/convert-to-path)))
|
(when (empty? new-content)
|
||||||
(rx/of (dch/commit-changes changes)
|
(rx/of (dwe/clear-edition-mode)))))))))))
|
||||||
(when (empty? new-content)
|
|
||||||
(dwe/clear-edition-mode)))))))))))
|
|
||||||
|
|
||||||
(defn make-corner
|
(defn make-corner
|
||||||
([]
|
([]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue