fix(ui): zoom the architecture scenes toward the cursor

Wheel zoom in the Overview, Routes, System structure and Behavior scenes
moved the orthographic camera along its view direction only, so scrolling
over a corner of the map always zoomed into the screen centre. The
installed three-stdlib OrbitControls support zoomToCursor for orthographic
cameras: they keep the point under the cursor fixed and move the orbit
target with it, which the fit and scope-camera code already reads back.

Signed-off-by: Bernhard Jackiewicz <bj@techport.io>
This commit is contained in:
Bernhard Jackiewicz
2026-10-02 18:39:51 +02:00
parent 92224c4463
commit 6e400a35e7
2 changed files with 2 additions and 2 deletions
@@ -340,7 +340,7 @@ export function ArchitectureScene({ model: graphModel, selectedId, selectedEdgeI
<OrbitControls ref={controls} makeDefault enabled={active} enableRotate={!planar} enableDamping={false}
mouseButtons={{ LEFT: planar ? MOUSE.PAN : MOUSE.ROTATE, MIDDLE: MOUSE.DOLLY, RIGHT: MOUSE.PAN }}
touches={{ ONE: planar ? TOUCH.PAN : TOUCH.ROTATE, TWO: TOUCH.DOLLY_PAN }}
minZoom={0.15} maxZoom={60} rotateSpeed={0.5} zoomSpeed={0.8} maxPolarAngle={Math.PI / 2.05} />
minZoom={0.15} maxZoom={60} rotateSpeed={0.5} zoomSpeed={0.8} maxPolarAngle={Math.PI / 2.05} zoomToCursor />
<FitArchitecture model={model} planar={planar} resetKey={resetKey} controls={controls} active={active} />
{(adaptiveLabels || model.view === 'hotspots') && <HotspotLabels model={model} priorityId={selectedId ?? hoveredId} onVisible={setVisibleHotspotLabels} />}
</Canvas>
@@ -286,7 +286,7 @@ export default function SystemArchitectureScene({ model, selectedNode, selectedE
<OrbitControls makeDefault enabled={active} enableRotate={!planar} enableDamping={false}
mouseButtons={{ LEFT: planar ? MOUSE.PAN : MOUSE.ROTATE, MIDDLE: MOUSE.DOLLY, RIGHT: MOUSE.PAN }}
touches={{ ONE: planar ? TOUCH.PAN : TOUCH.ROTATE, TWO: TOUCH.DOLLY_PAN }}
minZoom={0.15} maxZoom={90} rotateSpeed={0.5} zoomSpeed={0.8} maxPolarAngle={Math.PI / 2.05} />
minZoom={0.15} maxZoom={90} rotateSpeed={0.5} zoomSpeed={0.8} maxPolarAngle={Math.PI / 2.05} zoomToCursor />
<ScopeCamera model={model} resetKey={resetKey} planar={planar} presentation={presentation} />
</Canvas>
</div></SceneBoundary>;