🎉 Stroke style support for wasm render

This commit is contained in:
Alejandro Alonso 2025-01-03 14:07:40 +01:00
parent e551dd5a99
commit 2467e033b7
3 changed files with 70 additions and 19 deletions

View file

@ -211,6 +211,14 @@
(store-image id))))))
fills))
(defn- translate-stroke-style
[stroke-style]
(case stroke-style
:dotted 1
:dashed 2
:mixed 3
0))
(defn set-shape-strokes
[strokes]
(h/call internal-module "_clear_shape_strokes")
@ -220,11 +228,12 @@
gradient (:stroke-color-gradient stroke)
image (:stroke-image stroke)
width (:stroke-width stroke)
align (:stroke-alignment stroke)]
align (:stroke-alignment stroke)
style (-> stroke :stroke-style translate-stroke-style)]
(case align
:inner (h/call internal-module "_add_shape_inner_stroke" width)
:outer (h/call internal-module "_add_shape_outer_stroke" width)
(h/call internal-module "_add_shape_center_stroke" width))
:inner (h/call internal-module "_add_shape_inner_stroke" width style)
:outer (h/call internal-module "_add_shape_outer_stroke" width style)
(h/call internal-module "_add_shape_center_stroke" width style))
(cond
(some? gradient)