mirror of
https://github.com/penpot/penpot.git
synced 2025-06-10 13:01:40 +02:00
✨ Serialize solid fills as bytes (wasm)
This commit is contained in:
parent
81f18ad7f4
commit
093fa18839
7 changed files with 73 additions and 24 deletions
|
@ -217,8 +217,12 @@
|
|||
image (:fill-image fill)]
|
||||
(cond
|
||||
(some? color)
|
||||
(let [rgba (sr-clr/hex->u32argb color opacity)]
|
||||
(h/call wasm/internal-module "_add_shape_solid_fill" rgba))
|
||||
(let [size sr-fills/SOLID-BYTE-SIZE
|
||||
offset (mem/alloc-bytes size)
|
||||
heap (mem/get-heap-u32)
|
||||
argb (sr-clr/hex->u32argb color opacity)]
|
||||
(sr-fills/write-solid-fill! offset heap argb)
|
||||
(h/call wasm/internal-module "_add_shape_solid_fill"))
|
||||
|
||||
(some? gradient)
|
||||
(let [size sr-fills/GRADIENT-BYTE-SIZE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue