Skip to content

Commit 21f7410

Browse files
fix(OrbitControls): orthographic zoom update (#328)
1 parent 8449f8e commit 21f7410

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/controls/OrbitControls.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,12 @@ class OrbitControls extends EventDispatcher {
362362
}
363363
}
364364
} else if (scope.object instanceof OrthographicCamera && scope.object.isOrthographicCamera) {
365-
scope.object.zoom = Math.max(scope.minZoom, Math.min(scope.maxZoom, scope.object.zoom / scale))
366-
scope.object.updateProjectionMatrix()
367-
zoomChanged = true
365+
zoomChanged = scale !== 1
366+
367+
if (zoomChanged) {
368+
scope.object.zoom = Math.max(scope.minZoom, Math.min(scope.maxZoom, scope.object.zoom / scale))
369+
scope.object.updateProjectionMatrix()
370+
}
368371
}
369372

370373
scale = 1

0 commit comments

Comments
 (0)