This commit is contained in:
Aitor Moreno
2025-05-08 13:30:47 +02:00
parent 2c46605e36
commit 1cd3c08736
9 changed files with 182 additions and 36 deletions

View File

@@ -79,6 +79,19 @@ function getHeapU32() {
return Module.HEAPU32;
}
export function clearShapeFills() {
Module._clear_shape_fills();
}
export function addShapeSolidFill(argb) {
const ptr = allocBytes(176);
const heap = getHeapU32();
const dv = new DataView(heap.buffer);
dv.setUint8(ptr, 0x00, true);
dv.setUint32(ptr + 4, argb, true);
Module._add_shape_fill();
}
export function setShapeChildren(shapeIds) {
const offset = allocBytes(shapeIds.length * 16);
const heap = getHeapU32();