MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / zoomAt

Function zoomAt

graph-ui/tools/handtest-fixes-galaxy.mjs:934–944  ·  view source on GitHub ↗

Zum Weltpunkt `world` hinzoomen: Zeiger dorthin, dann `steps` Mausrad-Schritte (die Szene zoomt zum Zeiger).

(page, world, steps)

Source from the content-addressed store, hash-verified

932
933/** Zum Weltpunkt `world` hinzoomen: Zeiger dorthin, dann `steps` Mausrad-Schritte (die Szene zoomt zum Zeiger). */
934async function zoomAt(page, world, steps) {
935 const box = await canvasBox(page);
936 const [at] = await page.evaluate((point) => globalThis.__atlasGalaxyFit?.project?.([{ x: point.x, y: point.y, z: 0 }]) ?? [], world);
937 const x = at ? box.x + Math.min(Math.max(at.x, 20), box.width - 20) : box.x + box.width / 2;
938 const y = at ? box.y + Math.min(Math.max(at.y, 20), box.height - 20) : box.y + box.height / 2;
939 await page.mouse.move(x, y);
940 for (let step = 0; step < steps; step += 1) { await page.mouse.wheel(0, -300); await wait(200); }
941 // Den Zeiger aus dem Bild nehmen, damit keine Karte eines Knotens ueber der Messung liegt.
942 await page.mouse.move(box.x + box.width - 4, box.y - 30);
943 await wait(2000);
944}
945
946/* ------------------------------------------------------------------ */
947/* K12: die Namen im Mini-Galaxy von Explore liegen nicht aufeinander */

Callers 1

checkK5Function · 0.85

Calls 2

canvasBoxFunction · 0.85
waitFunction · 0.70

Tested by

no test coverage detected