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
@@ -3,7 +3,7 @@ import { horizonFrom } from '../../geo/horizon.js';
import { densifyRhumb } from '../../geo/rhumb.js';
import { distance, toRadians } from '../../geo/vector.js';
import { cssColor } from '../../render/color.js';
import { cameraOf, drawOf } from '../../render/rendererOf.js';
import { cameraOf, canvasOf, drawOf } from '../../render/rendererOf.js';
import {
clampLabel,
createCableOverlayEntry,
@@ -418,7 +418,7 @@ export function createRendering({ state }) {
const pose = cameraOf(viewer).pose();
const cameraPos = pose?.position;
if (!cameraPos) return false;
const canvasHeight = viewer.scene?.canvas?.clientHeight || 1080;
const canvasHeight = canvasOf(viewer)?.clientHeight || 1080;
// The field of view along the canvas's longer side.
const fov =
pose.aspectRatio > 1