Merge pull request #18 from lucaskuzma/camera-fix

Update camera.js
This commit is contained in:
Paul Graffam 2018-10-24 11:15:33 -04:00 committed by GitHub
commit 7381928803
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -20,8 +20,8 @@ export default class Camera {
} }
updateSize(renderer) { updateSize(renderer) {
// Multiply by dpr in case it is retina device // Update camera aspect ratio with window aspect ratio
this.threeCamera.aspect = renderer.domElement.width * Config.dpr / renderer.domElement.height * Config.dpr; this.threeCamera.aspect = renderer.domElement.width / renderer.domElement.height;
// Always call updateProjectionMatrix on camera change // Always call updateProjectionMatrix on camera change
this.threeCamera.updateProjectionMatrix(); this.threeCamera.updateProjectionMatrix();