Skip to content

Commit

Permalink
fix(OrbitControls): orthographic zoom update (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett authored Dec 24, 2023
1 parent 8449f8e commit 21f7410
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/controls/OrbitControls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,12 @@ class OrbitControls extends EventDispatcher {
}
}
} else if (scope.object instanceof OrthographicCamera && scope.object.isOrthographicCamera) {
scope.object.zoom = Math.max(scope.minZoom, Math.min(scope.maxZoom, scope.object.zoom / scale))
scope.object.updateProjectionMatrix()
zoomChanged = true
zoomChanged = scale !== 1

if (zoomChanged) {
scope.object.zoom = Math.max(scope.minZoom, Math.min(scope.maxZoom, scope.object.zoom / scale))
scope.object.updateProjectionMatrix()
}
}

scale = 1
Expand Down

0 comments on commit 21f7410

Please sign in to comment.