Reach the canvas through canvasOf, not the viewer

Every file that read the renderer's canvas as rendererOf(viewer)?.canvas
falling back to viewer.canvas, and the share restoration's gesture
listeners on viewer.canvas, now ask canvasOf(viewer). The 20 canvas
reach-throughs leave the viewer access record.
This commit is contained in:
Sameh Khamis committed 2026-11-10 17:18:10 -08:00
1 parent 73735b080a
commit ebbe006924
13 files changed
+30 -43

No files matched your search

+2 -2
View File
@@ -12,10 +12,10 @@ import { heightsOf } from '../queries/heights.js';
import { fromDegrees, toLonLatH } from '../geo/ellipsoid.js';
import { distance } from '../geo/vector.js';
import {
canvasOf as sceneCanvasOf,
findCamera,
findFrame,
findQuery,
rendererOf,
} from '../render/rendererOf.js';
/** A label whose detailed outline could not be resolved. */
@@ -93,7 +93,7 @@ export function createScreenAnnotationRenderer(
let passQuery = null;
let passCanvas = null;
// The renderer's canvas; a viewer with no renderer bound, its own.
const canvasOf = () => rendererOf(viewer)?.canvas ?? viewer.canvas;
const canvasOf = () => sceneCanvasOf(viewer);
const records = new Map(); // anno.id -> { key, anno, group, parts }
const leaving = new Map(); // key -> a removed mark's record while it fades out
const byKey = new Map(); // key -> record, live or fading