mirror of
https://github.com/penpot/penpot.git
synced 2025-06-03 10:41:42 +02:00
♻️ Refactor path utils
This commit is contained in:
parent
0455aaa4cd
commit
de11e85d2b
21 changed files with 1076 additions and 980 deletions
|
@ -11,7 +11,7 @@
|
|||
[app.main.ui.shapes.attrs :as attrs]
|
||||
[app.main.ui.shapes.custom-stroke :refer [shape-custom-stroke]]
|
||||
[app.util.object :as obj]
|
||||
[app.util.geom.path :as ugp]))
|
||||
[app.util.path.format :as upf]))
|
||||
|
||||
;; --- Path Shape
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
|||
background? (unchecked-get props "background?")
|
||||
{:keys [id x y width height]} (:selrect shape)
|
||||
content (:content shape)
|
||||
pdata (mf/use-memo (mf/deps content) #(ugp/content->path content))
|
||||
pdata (mf/use-memo (mf/deps content) #(upf/format-path content))
|
||||
props (-> (attrs/extract-style-attrs shape)
|
||||
(obj/merge!
|
||||
#js {:d pdata}))]
|
||||
|
@ -39,3 +39,4 @@
|
|||
:base-props props
|
||||
:elem-name "path"}])))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue