mirror of
https://github.com/penpot/penpot.git
synced 2026-09-11 14:39:35 +00:00
🐛 Filter svg attrs supported in wasm
This commit is contained in:
parent
544b118925
commit
7350329658
@ -310,14 +310,18 @@
|
|||||||
(defn set-shape-path-attrs
|
(defn set-shape-path-attrs
|
||||||
[attrs]
|
[attrs]
|
||||||
(let [style (:style attrs)
|
(let [style (:style attrs)
|
||||||
|
;; Filter to only supported attributes
|
||||||
|
allowed-keys #{:fill :fillRule :strokeLinecap :strokeLinejoin}
|
||||||
attrs (-> attrs
|
attrs (-> attrs
|
||||||
(dissoc :style)
|
(dissoc :style)
|
||||||
(merge style))
|
(merge style)
|
||||||
|
(select-keys allowed-keys))
|
||||||
str (sr/serialize-path-attrs attrs)
|
str (sr/serialize-path-attrs attrs)
|
||||||
size (count str)
|
size (count str)]
|
||||||
offset (mem/alloc size)]
|
(when (pos? size)
|
||||||
(h/call wasm/internal-module "stringToUTF8" str offset size)
|
(let [offset (mem/alloc size)]
|
||||||
(h/call wasm/internal-module "_set_shape_path_attrs" (count attrs))))
|
(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
|
(defn set-shape-path-content
|
||||||
"Upload path content in chunks to WASM."
|
"Upload path content in chunks to WASM."
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user