mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
fix(embed): an inline panel's timer frames move the camera, take input and run the clock again
When a host stops animation frames, the panel drew from a timer with the
viewer's render(): the camera's flight and input, the clock's tick, then a
draw if due. Through the frame port it called renderNow(), which on Cesium
only forced a draw, so flights stood still, drags and zooms did nothing
and the clock stopped. renderNow takes {ifDue: true}: one tick of the
loop as its own would run it, drawing only a frame that is due (the
widget's render() on Cesium; the stub's tick without a forced request).
This commit is contained in:
1 parent
f4beb676ae
commit
03a7d8827a
9 files changed
+86
-22
No files matched your search
@@ -705,6 +705,22 @@ export function portChecks() {
|
||||
equal(drawnFrames, before + 1, 'renderNow drew synchronously');
|
||||
},
|
||||
),
|
||||
check(
|
||||
'frame.renderNow.ifDue',
|
||||
'renderNow({ifDue}) ticks the loop now and draws a frame that is due',
|
||||
async (h, r) => {
|
||||
let ticks = 0;
|
||||
let drawnFrames = 0;
|
||||
r.frame.on('preUpdate', () => (ticks += 1));
|
||||
r.frame.on('postRender', () => (drawnFrames += 1));
|
||||
await h.frame(r);
|
||||
const [ticked, drawn] = [ticks, drawnFrames];
|
||||
r.frame.requestRender('conformance');
|
||||
r.frame.renderNow({ ifDue: true });
|
||||
equal(ticks, ticked + 1, 'one tick, synchronously');
|
||||
equal(drawnFrames, drawn + 1, 'the asked-for frame drawn');
|
||||
},
|
||||
),
|
||||
check('frame.suspend', 'a suspended loop does not tick', async (h, r) => {
|
||||
let ticks = 0;
|
||||
r.frame.on('preUpdate', () => (ticks += 1));
|
||||
|
||||
Reference in new issue
Block a user