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

+1 -4
View File
@@ -71,9 +71,9 @@ import { eyeMoved, eyeRotatedAbout, eyeTurned } from './geo/eyeMoves.js';
import { heightsOf } from './queries/heights.js';
import {
cameraOf,
canvasOf,
findCamera,
findFrame,
rendererOf,
} from './render/rendererOf.js';
let _isCockpitActive = null;
@@ -1613,9 +1613,6 @@ function liveView(camera, pose = camera.pose()) {
return { ...pose, projection, live: true };
}
/** The canvas the renderer draws in (the viewer's own when none is bound). */
const canvasOf = (viewer) => rendererOf(viewer)?.canvas ?? viewer.canvas;
/**
* Whether a projection is a perspective one centred on the view: what the
* keyhole cone below assumes. Column-major, so element 11 is row 3 of