mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 01:32:19 +00:00
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:
1 parent
73735b080a
commit
ebbe006924
13 files changed
+30
-43
No files matched your search
@@ -62,7 +62,11 @@ import {
|
||||
import { onLocaleChange, t, translateKnown } from '../i18n/index.js';
|
||||
import { fromDegrees } from '../geo/index.js';
|
||||
import { cssColor } from '../render/color.js';
|
||||
import { drawOf, findFrame, rendererOf } from '../render/rendererOf.js';
|
||||
import {
|
||||
canvasOf as sceneCanvasOf,
|
||||
drawOf,
|
||||
findFrame,
|
||||
} from '../render/rendererOf.js';
|
||||
/** The longest note a row action leaves under its row, in characters. */
|
||||
const NOTE_MAX = 200;
|
||||
/** An action's answer as a row note: trimmed, and cut at a word with an ellipsis. */
|
||||
@@ -157,7 +161,7 @@ export function initDrawTool({
|
||||
previewPoints.dispose();
|
||||
};
|
||||
/** The canvas the renderer draws in (the viewer's own when none is bound). */
|
||||
const canvasOf = () => rendererOf(viewer)?.canvas ?? viewer.canvas;
|
||||
const canvasOf = () => sceneCanvasOf(viewer);
|
||||
const requestRender = () => findFrame(viewer)?.requestRender('draw-preview');
|
||||
// Teardown finishes synchronously; `whenSettled()` keeps its promise.
|
||||
const attaching = Promise.resolve();
|
||||
|
||||
Reference in new issue
Block a user