MCPcopy
hub / github.com/opentrace/opentrace / updatePositions

Method updatePositions

ui/src/components/pixi/PixiRenderer.ts:987–1004  ·  view source on GitHub ↗
(positions: Map<string, { x: number; y: number }>)

Source from the content-addressed store, hash-verified

985 // ─── Position Updates (called from simulation tick) ───────────────
986
987 updatePositions(positions: Map<string, { x: number; y: number }>): void {
988 for (const [id, pos] of positions) {
989 const node = this.nodes.get(id);
990 if (!node || !node.visible) continue;
991 node.x = pos.x;
992 node.y = pos.y;
993 // In 3D mode the ticker handles sprite positioning via projection each frame.
994 if (!this.mode3d) {
995 node.sprite.position.set(pos.x, pos.y);
996 if (node.label?.visible) {
997 const gap = this.labelGap(node);
998 node.label.position.set(pos.x + gap, pos.y);
999 }
1000 }
1001 }
1002
1003 this.postPositionUpdate();
1004 }
1005
1006 /**
1007 * Update positions from a Float64Array buffer (indexed by node order from setData).

Callers 1

Calls 3

labelGapMethod · 0.95
postPositionUpdateMethod · 0.95
getMethod · 0.65

Tested by

no test coverage detected