From 682866a7506a783e44b99908ca729841f388d5cc Mon Sep 17 00:00:00 2001 From: Nitish C <86357181+Nitish-bot@users.noreply.github.com> Date: Tue, 17 Nov 2026 02:45:58 +0530 Subject: [PATCH 1/2] fix wasm example --- crates/processing_wasm/examples/index.html | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/crates/processing_wasm/examples/index.html b/crates/processing_wasm/examples/index.html index 20bbd703..62aed17b 100644 --- a/crates/processing_wasm/examples/index.html +++ b/crates/processing_wasm/examples/index.html @@ -25,22 +25,23 @@ async function main() { await init(); await p.init(); - const surface = p.createSurface('canvas', 600, 600); + const surface = p.surfaceCreateFromCanvas('canvas', 600, 600); + const graphics = p.graphicsCreate(surface, 600, 600); - const bgImage = await p.loadImage('images/logo.png'); + const bgImage = await p.imageLoad('images/logo.png'); let frame = 0; function draw() { try { - p.beginDraw(surface); - p.backgroundImage(surface, bgImage); + p.beginDraw(graphics); + p.backgroundImage(graphics, bgImage); const x = 250 + Math.sin(frame * 0.02) * 200; - p.fill(surface, 0.9, 0.1, 0.3, 1.0); - p.rect(surface, x, 50, 100, 100, 20, 20, 20, 20); + p.setFill(graphics, 0.9, 0.1, 0.3, 1.0, 0 /* sRGB */); + p.rect(graphics, x, 50, 100, 100, 20, 20, 20, 20); - p.endDraw(surface); + p.endDraw(graphics); frame++; } catch (e) { From adfeffdb37dc16b9130e3528b9acb7b28531c184 Mon Sep 17 00:00:00 2001 From: Nitish C <86357181+Nitish-bot@users.noreply.github.com> Date: Tue, 17 Nov 2026 02:49:32 +0530 Subject: [PATCH 2/2] delete comment --- crates/processing_wasm/examples/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/processing_wasm/examples/index.html b/crates/processing_wasm/examples/index.html index 62aed17b..1a879e66 100644 --- a/crates/processing_wasm/examples/index.html +++ b/crates/processing_wasm/examples/index.html @@ -38,7 +38,7 @@ p.backgroundImage(graphics, bgImage); const x = 250 + Math.sin(frame * 0.02) * 200; - p.setFill(graphics, 0.9, 0.1, 0.3, 1.0, 0 /* sRGB */); + p.setFill(graphics, 0.9, 0.1, 0.3, 1.0, 0); p.rect(graphics, x, 50, 100, 100, 20, 20, 20, 20); p.endDraw(graphics);