fix orthographic aspect ratio
This commit is contained in:
parent
28afba27d5
commit
5d2f76e238
1 changed files with 9 additions and 1 deletions
|
|
@ -767,7 +767,15 @@ function requestRefresh(timeout) {
|
||||||
|
|
||||||
function onResize() {
|
function onResize() {
|
||||||
updateLastAction();
|
updateLastAction();
|
||||||
camera.aspect = aspect();
|
if (camera.isPerspectiveCamera) {
|
||||||
|
camera.aspect = aspect();
|
||||||
|
} else if (camera.isOrthographicCamera) {
|
||||||
|
const asp = aspect();
|
||||||
|
camera.left = -100 * asp;
|
||||||
|
camera.right = 100 * asp;
|
||||||
|
camera.top = 100;
|
||||||
|
camera.bottom = -100;
|
||||||
|
}
|
||||||
camera.updateProjectionMatrix();
|
camera.updateProjectionMatrix();
|
||||||
renderer.setSize(width(), height());
|
renderer.setSize(width(), height());
|
||||||
container.style.width = width();
|
container.style.width = width();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue