mirror of
https://github.com/penpot/penpot.git
synced 2026-07-29 09:26:14 +00:00
🐛 Ensure path content is always PathData when saving
The save-path-content function only converted content to PathData when there was a trailing :move-to command. When there was no trailing :move-to, the content from get-path was stored as-is, which could be a plain vector if the shape was already a :path type with non-PathData content. This caused segment/get-points to fail with 'can't access property "get", cache is undefined' when the with-cache macro tried to access the cache field on a non-PathData object. The fix ensures content is always converted to PathData via path/content before being stored in the state. Signed-off-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
parent
b484415a9f
commit
d051a3ba45
@ -69,7 +69,7 @@
|
||||
content (if (and (not preserve-move-to)
|
||||
(= (-> content last :command) :move-to))
|
||||
(path/content (take (dec (count content)) content))
|
||||
content)]
|
||||
(path/content content))]
|
||||
(st/set-content state content)))
|
||||
|
||||
ptk/WatchEvent
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user