Merge pull request #6714 from penpot/niwinz-staging-fix-path-edition

🐛 Fix unexpected exception on selectiong node on non path shape
This commit is contained in:
Alejandro Alonso 2025-06-18 10:45:36 +02:00 committed by GitHub
commit 2a5b087aa4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 17 deletions

View file

@ -470,6 +470,8 @@
"Given a content and a set of points return all the segments in the path
that uses the points"
[content points]
(assert (impl/path-data? content) "expected path data instance")
(let [point-set (set points)]
(loop [result (transient [])
prev-point nil

View file

@ -46,6 +46,7 @@
(i/icon-xref :snap-nodes (stl/css :snap-nodes-icon :pathbar-icon)))
(defn check-enabled [content selected-points]
(when content
(let [segments (path.segm/get-segments-with-points content selected-points)
num-segments (count segments)
num-points (count selected-points)
@ -63,7 +64,7 @@
:remove-node points-selected?
:merge-nodes segments-selected?
:join-nodes (and points-selected? (>= num-points 2) (< num-segments max-segments))
:separate-nodes segments-selected?}))
:separate-nodes segments-selected?})))
(mf/defc path-actions*
[{:keys [shape edit-path]}]