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:
Alejandro Alonso 2025-06-25 07:25:13 +02:00 committed by GitHub
commit e1ce7ec787
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 12 deletions

View file

@ -304,11 +304,8 @@
(ptk/reify ::handle-drawing-end
ptk/UpdateEvent
(update [_ state]
(let [content (dm/get-in state [:workspace-drawing :object :content])]
(assert (path/check-path-content content)
"expected valid path content instance")
(let [content (some-> (dm/get-in state [:workspace-drawing :object :content])
(path/check-path-content))]
(if (> (count content) 1)
(assoc-in state [:workspace-drawing :object :initialized?] true)
state)))

View file

@ -7,7 +7,6 @@
(ns app.main.data.workspace.path.tools
(:require
[app.common.data.macros :as dm]
[app.common.files.helpers :as cfh]
[app.common.types.path :as path]
[app.common.types.path.segment :as path.segment]
[app.main.data.changes :as dch]
@ -48,12 +47,10 @@
(changes/generate-path-changes it objects page-id shape (:content shape) new-content)]
(rx/concat
(if (cfh/path-shape? shape)
(rx/empty)
(rx/of (dwsh/update-shapes [id] path/convert-to-path)))
(rx/of (dch/commit-changes changes)
(when (empty? new-content)
(dwe/clear-edition-mode)))))))))))
(rx/of (dwsh/update-shapes [id] path/convert-to-path)
(dch/commit-changes changes))
(when (empty? new-content)
(rx/of (dwe/clear-edition-mode)))))))))))
(defn make-corner
([]