mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 11:18:36 +00:00
♻️ Use d/xf:add-index in custom stroke shape component
Signed-off-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
parent
5a47b5cf98
commit
8d89f2bdde
@ -485,6 +485,10 @@
|
|||||||
shape-shadow (get shape :shadow)
|
shape-shadow (get shape :shadow)
|
||||||
shape-strokes (not-empty strokes)
|
shape-strokes (not-empty strokes)
|
||||||
|
|
||||||
|
strokes
|
||||||
|
(mf/with-memo [strokes]
|
||||||
|
(rseq (into [] d/xf:add-index strokes)))
|
||||||
|
|
||||||
svg-attrs (attrs/get-svg-props shape render-id)
|
svg-attrs (attrs/get-svg-props shape render-id)
|
||||||
|
|
||||||
style (-> (obj/get props "style")
|
style (-> (obj/get props "style")
|
||||||
@ -509,7 +513,7 @@
|
|||||||
|
|
||||||
(when (some? shape-strokes)
|
(when (some? shape-strokes)
|
||||||
[:> :g props
|
[:> :g props
|
||||||
(for [[index value] (reverse (d/enumerate shape-strokes))]
|
(for [{:keys [::d/index] :as value} strokes]
|
||||||
[:& shape-custom-stroke {:shape shape
|
[:& shape-custom-stroke {:shape shape
|
||||||
:stroke value
|
:stroke value
|
||||||
:index index
|
:index index
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user