Skip to content

Commit

Permalink
fix: 1966 View respects manual ortho camera (#1991)
Browse files Browse the repository at this point in the history
  • Loading branch information
talkingtab authored Jan 15, 2025
1 parent 1a79a03 commit 2b14863
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/web/View.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,17 @@ function prepareSkissor(
let autoClear
const aspect = width / height
if (isOrthographicCamera(state.camera)) {
if (
state.camera.left !== width / -2 ||
state.camera.right !== width / 2 ||
state.camera.top !== height / 2 ||
state.camera.bottom !== height / -2
) {
Object.assign(state.camera, { left: width / -2, right: width / 2, top: height / 2, bottom: height / -2 })
if (!state.camera.manual) {
if (
state.camera.left !== width / -2 ||
state.camera.right !== width / 2 ||
state.camera.top !== height / 2 ||
state.camera.bottom !== height / -2
) {
Object.assign(state.camera, { left: width / -2, right: width / 2, top: height / 2, bottom: height / -2 })
state.camera.updateProjectionMatrix()
}
} else {
state.camera.updateProjectionMatrix()
}
} else if (state.camera.aspect !== aspect) {
Expand Down

0 comments on commit 2b14863

Please sign in to comment.