From 735032965810dd59136ec8c5e890ff8fb677ca42 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Thu, 16 Oct 2025 13:17:25 +0200 Subject: [PATCH] :bug: Filter svg attrs supported in wasm --- frontend/src/app/render_wasm/api.cljs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/render_wasm/api.cljs b/frontend/src/app/render_wasm/api.cljs index f01ebd70fa..01c90b7ce1 100644 --- a/frontend/src/app/render_wasm/api.cljs +++ b/frontend/src/app/render_wasm/api.cljs @@ -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."