mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 01:02:23 +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
Vendored
+7
-2
@@ -72,8 +72,13 @@ export interface FramePort {
|
||||
diagnostics(): FrameDiagnostics;
|
||||
/** Stop ticking while the page is hidden; resume on `false`. */
|
||||
suspend(hidden: boolean): void;
|
||||
/** Draw a frame now, synchronously; throws when the frame fails to draw. */
|
||||
renderNow(): void;
|
||||
/**
|
||||
* Draw a frame now, synchronously; throws when the frame fails to draw.
|
||||
* `ifDue`: run one tick of the loop now as its own would (camera flight,
|
||||
* input, clock), drawing only if a frame is due, for a host that stops
|
||||
* the animation frames the loop runs on.
|
||||
*/
|
||||
renderNow(options?: { ifDue?: boolean }): void;
|
||||
/** Resolves after the next frame has been drawn and presented. */
|
||||
renderOnce(options?: { timeoutMs?: number }): Promise<void>;
|
||||
/** Cap the loop's rate; 0 is the display's rate. */
|
||||
|
||||
Reference in new issue
Block a user