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

+7 -6
View File
@@ -1,6 +1,6 @@
import { isPointerFree } from '../../data/inputOwnership.js';
import { inputFor } from '../../input/dispatcher.js';
import { findCamera, findFrame } from '../../render/rendererOf.js';
import { canvasOf, findCamera, findFrame } from '../../render/rendererOf.js';
const HOVER_PICK_INTERVAL_MS = 120;
@@ -25,8 +25,9 @@ export function createLaunchHover({
let pendingPosition = null;
let trailingTimer = null;
const clearCursor = () => {
if (ownsCursor && viewer.scene.canvas.style.cursor === 'pointer')
viewer.scene.canvas.style.cursor = '';
const canvas = canvasOf(viewer);
if (ownsCursor && canvas.style.cursor === 'pointer')
canvas.style.cursor = '';
ownsCursor = false;
};
const cancelTrailing = () => {
@@ -60,7 +61,7 @@ export function createLaunchHover({
const pick = (position, at) => {
lastPick = at;
if (launchAt(position)) {
viewer.scene.canvas.style.cursor = 'pointer';
canvasOf(viewer).style.cursor = 'pointer';
ownsCursor = true;
} else clearCursor();
};
@@ -215,8 +216,8 @@ export function createLifecycle({
parts.selection.stopMissionZoomAnchor();
parts.rendering.showMissions(false);
parts.orbitRendering.syncMissionOrbitPrimitiveVisibility();
if (layerState._viewer?.scene?.canvas)
layerState._viewer.scene.canvas.style.cursor = '';
const canvas = canvasOf(layerState._viewer);
if (canvas) canvas.style.cursor = '';
parts.launchPad.hideLaunchPadZone();
parts.overlays.hideReplayVehicleOverlay();
layerState._selectedLaunchId = null;