From b7c1b03a8138bbb3687aa46a2f155c11caf73d5d Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Sat, 5 Aug 2023 10:31:01 +0200 Subject: [PATCH] refactor(examples): update to new geom API --- examples/fiber-basics/src/index.ts | 4 ++-- examples/trace-bitmap/src/state/process.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/fiber-basics/src/index.ts b/examples/fiber-basics/src/index.ts index 6c353180a3..31e6c61747 100644 --- a/examples/fiber-basics/src/index.ts +++ b/examples/fiber-basics/src/index.ts @@ -55,7 +55,7 @@ const cell = ( for (let [a, hh] of zip(alpha, symmetric(height))) { // add cell rect to scene const attribs = { fill: setAlpha(null, col, a) }; - scene.children.push( + scene.add( isVertical ? rect([x, y], [w, hh], attribs) : rect([y, x], [hh, w], attribs) @@ -84,7 +84,7 @@ const cell = ( // fiber to clear given geometry group on each iteration function* beginFrame(scene: Group) { while (true) { - scene.children.length = 0; + scene.clear(); yield; } } diff --git a/examples/trace-bitmap/src/state/process.ts b/examples/trace-bitmap/src/state/process.ts index 8d67f46ce7..33060dbf6b 100644 --- a/examples/trace-bitmap/src/state/process.ts +++ b/examples/trace-bitmap/src/state/process.ts @@ -130,7 +130,7 @@ export const main = sync({ } if (lines && lines.length) { numLines += lines.length; - root.children.push( + root.add( splitArcLength( group( { @@ -147,7 +147,7 @@ export const main = sync({ } if (pts && pts.length) { numPoints += pts.length; - root.children.push( + root.add( points(pts, { fill: layer.color, __axi: {