MCPcopy
hub / github.com/opentrace/opentrace / isInViewport

Method isInViewport

ui/src/components/pixi/PixiRenderer.ts:1402–1410  ·  view source on GitHub ↗

Check if a point is within the visible viewport (with margin).

(wx: number, wy: number)

Source from the content-addressed store, hash-verified

1400
1401 /** Check if a point is within the visible viewport (with margin). */
1402 private isInViewport(wx: number, wy: number): boolean {
1403 const sx = wx * this.vp.scale + this.vp.x;
1404 const sy = wy * this.vp.scale + this.vp.y;
1405 const mx = this.width * VIEWPORT_CULL_MARGIN;
1406 const my = this.height * VIEWPORT_CULL_MARGIN;
1407 return (
1408 sx >= -mx && sx <= this.width + mx && sy >= -my && sy <= this.height + my
1409 );
1410 }
1411
1412 private redrawAllEdges(): void {
1413 if (!this.edgeBgGfx || !this.edgeFgGfx) return;

Callers 1

redrawAllEdgesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected