mirror of
https://github.com/penpot/penpot.git
synced 2025-07-17 13:47:13 +02:00
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:
commit
2a5b087aa4
2 changed files with 20 additions and 17 deletions
|
@ -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
|
||||
|
|
|
@ -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]}]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue