🐛 Fix svg attrs stroke-linecap stroke-linejoin fill-rule

This commit is contained in:
Belén Albeza 2025-11-25 09:57:36 +01:00 committed by Alonso Torres
parent 2640889dc8
commit 33417a4b20

View File

@ -468,14 +468,14 @@
[attrs] [attrs]
(let [style (:style attrs) (let [style (:style attrs)
;; Filter to only supported attributes ;; Filter to only supported attributes
allowed-keys #{:fill :fillRule :strokeLinecap :strokeLinejoin} allowed-keys #{:fill :fillRule :fill-rule :strokeLinecap :stroke-linecap :strokeLinejoin :stroke-linejoin}
attrs (-> attrs attrs (-> attrs
(dissoc :style) (dissoc :style)
(merge style) (merge style)
(select-keys allowed-keys)) (select-keys allowed-keys))
fill-rule (-> attrs :fillRule sr/translate-fill-rule) fill-rule (or (-> attrs :fill-rule sr/translate-fill-rule) (-> attrs :fillRule sr/translate-fill-rule))
stroke-linecap (-> attrs :strokeLinecap sr/translate-stroke-linecap) stroke-linecap (or (-> attrs :stroke-linecap sr/translate-stroke-linecap) (-> attrs :strokeLinecap sr/translate-stroke-linecap))
stroke-linejoin (-> attrs :strokeLinejoin sr/translate-stroke-linejoin) stroke-linejoin (or (-> attrs :stroke-linejoin sr/translate-stroke-linejoin) (-> attrs :strokeLinejoin sr/translate-stroke-linejoin))
fill-none (= "none" (-> attrs :fill))] fill-none (= "none" (-> attrs :fill))]
(h/call wasm/internal-module "_set_shape_svg_attrs" fill-rule stroke-linecap stroke-linejoin fill-none))) (h/call wasm/internal-module "_set_shape_svg_attrs" fill-rule stroke-linecap stroke-linejoin fill-none)))