Refine smooth zoom handling during view mode changes and camera updates

This commit is contained in:
2026-04-27 00:54:21 +02:00
parent d2d0e42e9e
commit c98d513ebf

View File

@@ -1188,6 +1188,7 @@ export class ViewportHost {
this.cameraSpherical.theta = cameraState.perspectiveOrbit.theta; this.cameraSpherical.theta = cameraState.perspectiveOrbit.theta;
this.cameraSpherical.phi = cameraState.perspectiveOrbit.phi; this.cameraSpherical.phi = cameraState.perspectiveOrbit.phi;
this.orthographicCamera.zoom = cameraState.orthographicZoom; this.orthographicCamera.zoom = cameraState.orthographicZoom;
this.cancelSmoothZoom();
this.applyViewModePose(); this.applyViewModePose();
} }
@@ -1367,6 +1368,7 @@ export class ViewportHost {
return; return;
} }
this.finishSmoothZoom();
this.viewMode = viewMode; this.viewMode = viewMode;
this.lastClickPointer = null; this.lastClickPointer = null;
this.lastClickSelectionKey = null; this.lastClickSelectionKey = null;
@@ -1402,6 +1404,7 @@ export class ViewportHost {
return; return;
} }
this.cancelSmoothZoom();
this.cameraTarget.set( this.cameraTarget.set(
focusTarget.center.x, focusTarget.center.x,
focusTarget.center.y, focusTarget.center.y,