🐛 Filter svg attrs supported in wasm
Some checks failed
_STAGING / build-bundle (push) Has been cancelled
_STAGING / build-docker (push) Has been cancelled
_DEVELOP / build-bundle (push) Has been cancelled
_DEVELOP / build-docker (push) Has been cancelled
Commit Message Check / Check Commit Message (push) Has been cancelled

This commit is contained in:
Alejandro Alonso
2025-10-16 13:17:25 +02:00
committed by Alonso Torres
parent 544b118925
commit 7350329658

View File

@@ -310,14 +310,18 @@
(defn set-shape-path-attrs
[attrs]
(let [style (:style attrs)
;; Filter to only supported attributes
allowed-keys #{:fill :fillRule :strokeLinecap :strokeLinejoin}
attrs (-> attrs
(dissoc :style)
(merge style))
(merge style)
(select-keys allowed-keys))
str (sr/serialize-path-attrs attrs)
size (count str)
offset (mem/alloc size)]
(h/call wasm/internal-module "stringToUTF8" str offset size)
(h/call wasm/internal-module "_set_shape_path_attrs" (count attrs))))
size (count str)]
(when (pos? size)
(let [offset (mem/alloc size)]
(h/call wasm/internal-module "stringToUTF8" str offset size)
(h/call wasm/internal-module "_set_shape_path_attrs" (count attrs))))))
(defn set-shape-path-content
"Upload path content in chunks to WASM."