From 0b03df4c27a2fb0a66dcc524992d0465e64bf487 Mon Sep 17 00:00:00 2001 From: Bernhard Jackiewicz Date: Fri, 2 Oct 2026 18:42:48 +0200 Subject: [PATCH] fix(ui): zoom the galaxy toward the cursor Wheel zoom moved the camera exactly along its view direction for every cursor position, so the reader could not zoom into the part of the graph they were pointing at. The Galaxy OrbitControls now use zoomToCursor, which three-stdlib 2.36 supports and drei passes through. Fits and fly-tos still set the pivot themselves, and the distance limits apply to the new radius. Signed-off-by: Bernhard Jackiewicz --- graph-ui/src/galaxy/GraphScene.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/graph-ui/src/galaxy/GraphScene.tsx b/graph-ui/src/galaxy/GraphScene.tsx index 52b3de151..d67fcdd2f 100644 --- a/graph-ui/src/galaxy/GraphScene.tsx +++ b/graph-ui/src/galaxy/GraphScene.tsx @@ -90,6 +90,8 @@ * 15. Neu (Review-Call 2026-10-02): `FitContainment` holt Knoten, die nach * einer Einpassung dazukommen, ins Bild, indem die Kamera entlang ihrer * Blickrichtung zuruecktritt, solange der Leser sie nicht bewegt hat. + * 16. Neu (Review-Call 2026-10-02): die OrbitControls zoomen zum Mauszeiger + * (`zoomToCursor`), nicht mehr in die Bildmitte. */ import { useState, useRef, useEffect, useCallback, useMemo } from 'react'; @@ -1020,6 +1022,14 @@ export function GraphScene({ dampingFactor={0.08} rotateSpeed={0.5} zoomSpeed={1.5} + /* + * Aenderung 16: das Mausrad zoomt dorthin, wo der Zeiger steht, + * und nicht in die Bildmitte (Review-Befund G3). three-stdlib + * versetzt dabei auch den Drehpunkt; die Einpassung und jeder + * Anflug setzen ihn ohnehin selbst, und die Grenzen der + * Entfernung gelten fuer den neuen Abstand genauso. + */ + zoomToCursor minDistance={Math.max(5, sceneRadius * 0.02)} maxDistance={Math.max(sceneRadius, orbitReach) * 4} autoRotateSpeed={0.4}