mirror of
https://github.com/penpot/penpot.git
synced 2025-07-19 16:17:20 +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
|
;; 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*
|
(defn- calc-bool-content*
|
||||||
"Calculate the boolean content from shape and objects. Returns plain
|
"Calculate the boolean content from shape and objects. Returns plain
|
||||||
vector of segments"
|
vector of segments"
|
||||||
|
|
|
@ -272,7 +272,8 @@
|
||||||
hover-handlers
|
hover-handlers
|
||||||
hover-points
|
hover-points
|
||||||
snap-toggled]
|
snap-toggled]
|
||||||
:as edit-path} (mf/deref edit-path-ref)
|
:as edit-path}
|
||||||
|
(mf/deref edit-path-ref)
|
||||||
|
|
||||||
selected-points (or selected-points #{})
|
selected-points (or selected-points #{})
|
||||||
shape (hooks/use-equal-memo shape)
|
shape (hooks/use-equal-memo shape)
|
||||||
|
@ -282,7 +283,7 @@
|
||||||
|
|
||||||
base-points
|
base-points
|
||||||
(mf/with-memo [base-content]
|
(mf/with-memo [base-content]
|
||||||
(path.segment/get-points base-content))
|
(path/get-points base-content))
|
||||||
|
|
||||||
content
|
content
|
||||||
(mf/with-memo [base-content content-modifiers]
|
(mf/with-memo [base-content content-modifiers]
|
||||||
|
@ -290,7 +291,7 @@
|
||||||
|
|
||||||
content-points
|
content-points
|
||||||
(mf/with-memo [content]
|
(mf/with-memo [content]
|
||||||
(path.segment/get-points content))
|
(path/get-points content))
|
||||||
|
|
||||||
point->base (->> (map hash-map content-points base-points) (reduce merge))
|
point->base (->> (map hash-map content-points base-points) (reduce merge))
|
||||||
base->point (map-invert point->base)
|
base->point (map-invert point->base)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue