Read the canvas from the renderer in the layers, voice and tools

Files off the Cesium list sized themselves by, listened on and set the
cursor of `viewer.scene.canvas`. They now read `canvasOf(viewer)` from
src/render/rendererOf.js: the bound renderer's canvas, else the viewer's
own, the same element. Recent Imagery's divider moves the split through the
globe port (`globeSplitTarget`, moved from the flood event into
src/ui/imagerySplit.js), and traffic flow passes the viewer to the listed
surface module (`viewerRoadSurface`) instead of reaching for its scene.

The test fakes give their viewers a canvas, and the fake renderers report
it, as the Cesium renderer reports the viewer's.
This commit is contained in:
Sameh Khamis committed 2026-11-07 18:10:39 -08:00
1 parent abe9f97768
commit b19fa56565
49 files changed
+269 -119

No files matched your search

+2 -2
View File
@@ -22,7 +22,7 @@ import { createToast } from '../ui/toast.js';
import { buildPlaybackQueue, playSceneQueue } from '../director/playback.js';
import { createScenePlaybackAdapter } from './playbackAdapter.js';
import { toRadians } from '../geo/vector.js';
import { cameraOf, findCamera, rendererOf } from '../render/rendererOf.js';
import { cameraOf, canvasOf, findCamera } from '../render/rendererOf.js';
import {
SCENE_APPEND_RECIPES,
SCENE_RECIPES,
@@ -137,7 +137,7 @@ export class SceneDirector {
this._cameraHandoffUnsubscribe =
styleManager.subscribeCameraHandoff?.(yieldCamera);
// A viewer of the caller's own, with no renderer bound, has its canvas.
const canvas = rendererOf(viewer)?.canvas ?? viewer.scene?.canvas;
const canvas = canvasOf(viewer);
for (const event of ['pointerdown', 'wheel'])
canvas?.addEventListener(event, yieldCamera, { passive: true });
this._removeCameraInput = () => {