mirror of
https://github.com/penpot/penpot.git
synced 2025-06-03 23:51:38 +02:00
⚡ Improve path rendering performance.
This commit is contained in:
parent
bc04a0b9f0
commit
3d6c903273
5 changed files with 101 additions and 102 deletions
|
@ -20,21 +20,18 @@
|
|||
[props]
|
||||
(let [shape (unchecked-get props "shape")
|
||||
content (:content shape)
|
||||
pdata (mf/use-memo
|
||||
(mf/deps content)
|
||||
(fn []
|
||||
(try
|
||||
(upf/format-path content)
|
||||
(catch :default e
|
||||
(log/error :hint "unexpected error on formating path"
|
||||
:shape-name (:name shape)
|
||||
:shape-id (:id shape)
|
||||
:cause e)
|
||||
""))))
|
||||
pdata (mf/with-memo [content]
|
||||
(try
|
||||
(upf/format-path content)
|
||||
(catch :default e
|
||||
(log/error :hint "unexpected error on formating path"
|
||||
:shape-name (:name shape)
|
||||
:shape-id (:id shape)
|
||||
:cause e)
|
||||
"")))
|
||||
|
||||
props (-> (attrs/extract-style-attrs shape)
|
||||
(obj/merge!
|
||||
#js {:d pdata}))]
|
||||
(obj/set! "d" pdata))]
|
||||
|
||||
[:& shape-custom-stroke {:shape shape}
|
||||
[:> :path props]]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue