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

+4 -3
View File
@@ -17,7 +17,7 @@ import {
tn,
translateKnown,
} from '../i18n/index.js';
import { createImagerySplit } from './imagerySplit.js';
import { createImagerySplit, globeSplitTarget } from './imagerySplit.js';
import RecentImageryReadout from './recentImagery/RecentImageryReadout.vue';
import {
PRODUCTS,
@@ -27,6 +27,7 @@ import {
import { displayDay, displayMetres } from '../layers/recentImagery/display.js';
import { formatQuantity } from './unitLabels.js';
import { pointerOwnerName } from '../data/pointerOwnerNames.js';
import { canvasOf, findGlobe } from '../render/rendererOf.js';
const PANEL_ID = 'recent-imagery-panel';
const OVERVIEW_MIN_BOX_KM = 25;
@@ -701,7 +702,7 @@ export function createRecentImageryPanel({
}
if (!live || split || destroyed) return;
split = createSplit({
scene: viewer?.scene,
scene: globeSplitTarget(findGlobe(viewer)),
initialValue: snapshot.split,
id: 'recent-imagery-split-line',
handleClass: 'recent-imagery-split-handle',
@@ -722,7 +723,7 @@ export function createRecentImageryPanel({
right: rightPercent,
}),
getViewportWidth: () =>
Number(viewer?.scene?.canvas?.clientWidth) ||
Number(canvasOf(viewer)?.clientWidth) ||
Number(document.documentElement?.clientWidth) ||
0,
onChange: (value) => layer.setSplit(value),