diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index f847a49ec88f..45097fd7ed7d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -107,6 +107,8 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu * [Jeremy Marzano](https://github.com/JeremyMarzano-ISPA/) * [Orbit Logic](http://www.orbitlogic.com) * [Roderick Green](https://github.com/roderickgreen/) +* [Outdooractive](https://www.outdooractive.com) + * [Guillaume Lathoud](https://github.com/glathoud/) ## [Individual CLA](Documentation/Contributors/CLAs/individual-cla-agi-v1.0.txt) * [Victor Berchet](https://github.com/vicb) diff --git a/Source/Widgets/CesiumWidget/CesiumWidget.js b/Source/Widgets/CesiumWidget/CesiumWidget.js index 6a28e30dc94d..e0ed4e632b08 100644 --- a/Source/Widgets/CesiumWidget/CesiumWidget.js +++ b/Source/Widgets/CesiumWidget/CesiumWidget.js @@ -120,10 +120,11 @@ define([ var canvas = widget._canvas; var width = canvas.width; var height = canvas.height; + var useWebVR = widget._useWebVR = widget.scene._useWebVR; if (width !== 0 && height !== 0) { var frustum = widget._scene.camera.frustum; if (defined(frustum.aspectRatio)) { - frustum.aspectRatio = width / height; + frustum.aspectRatio = useWebVR ? (width >> 1) / height : width / height; } else { frustum.top = frustum.right * (height / width); frustum.bottom = -frustum.top; @@ -672,7 +673,8 @@ define([ var canvas = this._canvas; var width = canvas.clientWidth; var height = canvas.clientHeight; - if (!this._forceResize && this._canvasWidth === width && this._canvasHeight === height) { + var useWebVR = this.scene._useWebVR; + if (!this._forceResize && this._canvasWidth === width && this._canvasHeight === height && this._useWebVR === useWebVR) { return; } this._forceResize = false;