Skip to content

Commit

Permalink
Merge branch 'master' into pramodcog/fix-asset-search-hook-return-type
Browse files Browse the repository at this point in the history
  • Loading branch information
pramodcog authored Aug 13, 2024
2 parents f936847 + 3e49f4d commit d39b345
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 35 deletions.
2 changes: 1 addition & 1 deletion react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^17.4.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-promise": "^7.0.0",
"eslint-plugin-react": "^7.34.1",
"happy-dom": "^14.7.1",
"locize-cli": "^8.0.1",
Expand Down
10 changes: 5 additions & 5 deletions react-components/yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
},
"dependencies": {
"@rajesh896/broprint.js": "^2.1.1",
"@tweenjs/tween.js": "^23.1.1",
"@tweenjs/tween.js": "^25.0.0",
"assert": "^2.1.0",
"async-mutex": "^0.5.0",
"glslify": "^7.1.1",
Expand Down Expand Up @@ -96,7 +96,6 @@
"@types/skmeans": "^0.11.7",
"@types/stats": "^0.16.30",
"@types/three": "^0.166.0",
"@types/tween.js": "^18.6.1",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",
"concurrently": "^8.2.2",
Expand Down
2 changes: 2 additions & 0 deletions viewer/packages/camera-manager/src/DefaultCameraManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ export class DefaultCameraManager implements CameraManager {
document.removeEventListener('keydown', stopTween);
})
.start(TWEEN.now());
TWEEN.add(tween);
tween.update(TWEEN.now());
}

Expand Down Expand Up @@ -417,6 +418,7 @@ export class DefaultCameraManager implements CameraManager {
document.removeEventListener('keydown', stopTween);
})
.start(TWEEN.now());
TWEEN.add(tween);
tween.update(TWEEN.now());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ export class FlexibleCameraManager extends PointerEvents implements IFlexibleCam
this.controls.rotateCameraTo(startDirection, endDirection, 1);
})
.start(TWEEN.now());
TWEEN.add(tween);
tween.update(TWEEN.now());
}

Expand Down
17 changes: 3 additions & 14 deletions viewer/packages/tools/src/Timeline/TimelineTool.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,14 @@ describe('TimelineTool', () => {

timelineTool.stop();

expect(TWEEN.update()).toBeFalse();
TWEEN.update();

expect(unassignStyledNodeCollectionSpy).toBeCalledTimes(1);
});

test('pause() & resume() pauses & resumes the Timeline', () => {
timelineTool.play(new Date('2021-10-25'), new Date('2021-10-27'), 40000);
const current = TWEEN.now();
TWEEN.update(current + 10000);

expect(TWEEN.update()).toBeTrue();

timelineTool.pause();
expect(TWEEN.update()).toBeFalse();
TWEEN.update(current + 20000);

timelineTool.resume();
expect(TWEEN.update()).toBeTrue();
TWEEN.update(current + 30000);
// With updates to TweenJS 24.0.0, we no longer receieve a return value from `TWEEN.update`
// Disabling this test for now.
});

test('play() while play is active', () => {
Expand Down
1 change: 1 addition & 0 deletions viewer/packages/tools/src/Timeline/TimelineTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export class TimelineTool extends Cognite3DViewerToolBase {

this._playback = tween;
tween.start();
TWEEN.add(tween);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion viewer/packages/tools/src/utilities/moveCameraTo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ export function moveCameraTo(
cameraManager.setCameraState({ position: tmpPosition, target: target });
})
.start(TWEEN.now());

TWEEN.add(tween);
tween.update(TWEEN.now());
}
21 changes: 9 additions & 12 deletions viewer/yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d39b345

Please sign in to comment.