Skip to content

Commit

Permalink
Fix clearScene function.
Browse files Browse the repository at this point in the history
  • Loading branch information
erksch committed Dec 28, 2019
1 parent 9bdc929 commit 91dee14
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ function main() {
let activeFrame = Number(frameSelector.value);

const clearScene = () => {
scene.children.forEach((child) => {
scene.remove(child);
});
while (scene.children.length) {
scene.remove(scene.children[0]);
}
};

const setActiveFrame = (nextActiveFrame: number) => {
Expand Down Expand Up @@ -146,6 +146,7 @@ function main() {
const handleSegmentChange = ([segmentId, numFrames]: Segment) => {
clearScene();
activeFrame = 0;
activeFrameDisplay.innerHTML = "0";
framePointMeshes = [];
frameBoundingBoxMeshes = [];
framesLoadedDisplay.innerHTML = "0";
Expand Down

0 comments on commit 91dee14

Please sign in to comment.