mirror of
https://github.com/penpot/penpot.git
synced 2026-03-20 17:33:44 +00:00
Merge branch 'main' into staging.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
(ns app.main.ui.shapes.path
|
||||
(:require
|
||||
[app.common.logging :as log]
|
||||
[app.main.ui.shapes.attrs :as attrs]
|
||||
[app.main.ui.shapes.custom-stroke :refer [shape-custom-stroke]]
|
||||
[app.util.object :as obj]
|
||||
@@ -19,10 +20,21 @@
|
||||
[props]
|
||||
(let [shape (unchecked-get props "shape")
|
||||
content (:content shape)
|
||||
pdata (mf/use-memo (mf/deps content) #(upf/format-path content))
|
||||
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)
|
||||
""))))
|
||||
|
||||
props (-> (attrs/extract-style-attrs shape)
|
||||
(obj/merge!
|
||||
#js {:d pdata}))]
|
||||
|
||||
[:& shape-custom-stroke {:shape shape}
|
||||
[:> :path props]]))
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
(ns app.main.ui.workspace.viewport.outline
|
||||
(:require
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.geom.shapes :as gsh]
|
||||
[app.common.pages :as cp]
|
||||
[app.main.refs :as refs]
|
||||
@@ -27,7 +28,9 @@
|
||||
path-data
|
||||
(mf/use-memo
|
||||
(mf/deps shape)
|
||||
#(when path? (upf/format-path (:content shape))))
|
||||
#(when path?
|
||||
(or (ex/ignoring (upf/format-path (:content shape)))
|
||||
"")))
|
||||
|
||||
{:keys [x y width height selrect]} shape
|
||||
|
||||
|
||||
Reference in New Issue
Block a user