mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-11-07 08:43:35 +08:00
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:
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user