mirror of
https://github.com/penpot/penpot.git
synced 2025-07-19 11:57:23 +02:00
🐛 Prevent NPE on get-points
This commit is contained in:
parent
122e5a4b57
commit
4e3abcbd45
2 changed files with 10 additions and 3 deletions
|
@ -164,6 +164,12 @@
|
|||
;; PATH SHAPE HELPERS
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn get-points
|
||||
"Returns points for the given segment, faster version of
|
||||
the `content->points`."
|
||||
[content]
|
||||
(some-> content segment/get-points))
|
||||
|
||||
(defn- calc-bool-content*
|
||||
"Calculate the boolean content from shape and objects. Returns plain
|
||||
vector of segments"
|
||||
|
|
|
@ -272,7 +272,8 @@
|
|||
hover-handlers
|
||||
hover-points
|
||||
snap-toggled]
|
||||
:as edit-path} (mf/deref edit-path-ref)
|
||||
:as edit-path}
|
||||
(mf/deref edit-path-ref)
|
||||
|
||||
selected-points (or selected-points #{})
|
||||
shape (hooks/use-equal-memo shape)
|
||||
|
@ -282,7 +283,7 @@
|
|||
|
||||
base-points
|
||||
(mf/with-memo [base-content]
|
||||
(path.segment/get-points base-content))
|
||||
(path/get-points base-content))
|
||||
|
||||
content
|
||||
(mf/with-memo [base-content content-modifiers]
|
||||
|
@ -290,7 +291,7 @@
|
|||
|
||||
content-points
|
||||
(mf/with-memo [content]
|
||||
(path.segment/get-points content))
|
||||
(path/get-points content))
|
||||
|
||||
point->base (->> (map hash-map content-points base-points) (reduce merge))
|
||||
base->point (map-invert point->base)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue