1
0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-05-29 07:06:11 +02:00

🎉 Render wasm blur support

This commit is contained in:
Alejandro Alonso 2025-01-09 13:51:12 +01:00
parent d500058aa9
commit 7cc33b1a1a
8 changed files with 117 additions and 11 deletions
frontend/src/app/render_wasm

View file

@ -346,7 +346,6 @@
[hidden]
(h/call internal-module "_set_shape_hidden" hidden))
(defn- translate-bool-type
[bool-type]
(case bool-type
@ -364,6 +363,19 @@
[content]
(set-shape-path-content content))
(defn- translate-blur-type
[blur-type]
(case blur-type
:layer-blur 1
0))
(defn set-shape-blur
[blur]
(let [type (-> blur :type translate-blur-type)
hidden (:hidden blur)
value (:value blur)]
(h/call internal-module "_set_shape_blur" type hidden value)))
(def debounce-render-without-cache (fns/debounce render-without-cache 100))
(defn set-view
@ -395,7 +407,8 @@
opacity (dm/get-prop shape :opacity)
hidden (dm/get-prop shape :hidden)
content (dm/get-prop shape :content)
bool-content (dm/get-prop shape :bool-content)]
bool-content (dm/get-prop shape :bool-content)
blur (dm/get-prop shape :blur)]
(use-shape id)
(set-shape-type type)
@ -407,6 +420,8 @@
(set-shape-children children)
(set-shape-opacity opacity)
(set-shape-hidden hidden)
(when (some? blur)
(set-shape-blur blur))
(when (and (some? content) (= type :path)) (set-shape-path-content content))
(when (some? bool-content) (set-shape-bool-content bool-content))
(let [pending' (concat (set-shape-fills fills) (set-shape-strokes strokes))]