0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 23:49:45 -05:00

🐛 Fix incorrect props transformation on custom strokes component

This commit is contained in:
Andrey Antukh 2024-01-24 11:17:13 +01:00
parent 508af62dc0
commit 22502ff7c8

View file

@ -31,7 +31,7 @@
suffix (if (some? index) (dm/str "-" index) "")
clip-id (dm/str "inner-stroke-" render-id "-" shape-id suffix)
href (dm/str "#stroke-shape-" render-id "-" shape-id suffix)]
[:> "clipPath" #js {:id clip-id}
[:> "clipPath" {:id clip-id}
[:use {:href href}]]))
(mf/defc outer-stroke-mask
@ -473,7 +473,7 @@
shape-blur (get shape :blur)
shape-fills (get shape :fills)
shape-shadow (get shape :shadow)
shape-strokes (get shape :strokes)
shape-strokes (not-empty (get shape :strokes))
svg-attrs (attrs/get-svg-props shape render-id)
@ -481,24 +481,22 @@
(obj/clone)
(attrs/add-layer-styles! shape))
props (-> svg-attrs
(obj/merge!
{:id stroke-id
:className "strokes"
:style style}))
props (mf/spread-props svg-attrs
{:id stroke-id
:className "strokes"
:style style})]
props (if ^boolean (cfh/frame-shape? shape)
props
(cond-> props
(and (some? shape-blur)
(not ^boolean (:hidden shape-blur)))
(obj/set! "filter" (dm/fmt "url(#filter-blur-%)" render-id))
(and (empty? shape-fills)
(some? (->> shape-shadow (remove :hidden) seq)))
(obj/set! "filter" (dm/fmt "url(#filter-%)" render-id))))]
(when-not ^boolean (cfh/frame-shape? shape)
(when (and (some? shape-blur)
(not ^boolean (:hidden shape-blur)))
(obj/set! props "filter" (dm/fmt "url(#filter-blur-%)" render-id)))
(when (d/not-empty? shape-strokes)
(when (and (empty? shape-fills)
(some? (->> shape-shadow (remove :hidden) not-empty)))
(obj/set! props "filter" (dm/fmt "url(#filter-%)" render-id))))
(when (some? shape-strokes)
[:> :g props
(for [[index value] (reverse (d/enumerate shape-strokes))]
[:& shape-custom-stroke {:shape shape