Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Dec 26, 2024
1 parent bc0e48a commit 83195f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions webgpu/lessons/webgpu-scene-graphs.md
Original file line number Diff line number Diff line change
Expand Up @@ -564,20 +564,20 @@ here's a few more tweaks.
// | +-child
// +-child
function addSceneGraphNodeToGUI(gui, node, last, prefix) {
+ const nodes = [];
+ const nodes = [];
if (node.source instanceof TRS) {
const label = `${prefix === undefined ? '' : `${prefix}${plusDash}`}${node.name}`;
- addButtonLeftJustified(gui, label, () => setCurrentSceneGraphNode(node));
+ nodes.push(addButtonLeftJustified(
+ gui, label, () => setCurrentSceneGraphNode(node)));
- addButtonLeftJustified(gui, label, () => setCurrentSceneGraphNode(node));
+ nodes.push(addButtonLeftJustified(
+ gui, label, () => setCurrentSceneGraphNode(node)));
const childPrefix = prefix === undefined
? ''
: `${prefix}${last ? threeSpaces : barTwoSpaces}`;
- node.children.forEach((child, i) => {
+ nodes.push(...node.children.map((child, i) => {
* const childLast = i === node.children.length - 1;
- addSceneGraphNodeToGUI(gui, child, childLast, childPrefix);
+ return addSceneGraphNodeToGUI(gui, child, childLast, childPrefix);
+ return addSceneGraphNodeToGUI(gui, child, childLast, childPrefix);
* }));
+ return nodes.flat();
}
Expand Down

0 comments on commit 83195f8

Please sign in to comment.