mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Set scene time through the Cesium frame port, in the application too
frame.setTime moves from the conformance renderer into the shared Cesium ports, so the application's renderer has it. It moves the clock and asks for a frame, which on-demand drawing needs. It no longer stops the clock: the conformance renderer stops its own at creation, and the application's clock keeps whatever state its owner gave it.
This commit is contained in:
1 parent
338b75b8d8
commit
1a40c5a30a
5 files changed
+32
-16
No files matched your search
@@ -697,3 +697,18 @@ test('an icon draws its atlas slot once the atlas has it, and again when it chan
|
||||
);
|
||||
ports.dispose();
|
||||
});
|
||||
|
||||
test('setTime moves scene time and draws it, leaving the clock running or not', () => {
|
||||
const { widget, scene } = tickingWidget();
|
||||
let requested = 0;
|
||||
scene.requestRender = () => (requested += 1);
|
||||
widget.clock.shouldAnimate = true;
|
||||
const ports = createCesiumPorts(widget, { capabilities: all });
|
||||
const t = Date.UTC(2026, 5, 21, 12);
|
||||
ports.frame.setTime(t);
|
||||
assert.equal(ports.frame.time(), t);
|
||||
assert.equal(widget.clock.shouldAnimate, true, 'still running');
|
||||
assert.equal(requested, 1, 'one frame asked for');
|
||||
assert.deepEqual(ports.frame.diagnostics().pendingReasons, ['time']);
|
||||
ports.dispose();
|
||||
});
|
||||
Reference in new issue
Block a user