Globe: Check for renderer on resize
This commit is contained in:
@@ -261,12 +261,14 @@ export class Globe {
|
|||||||
* Resize method
|
* Resize method
|
||||||
*/
|
*/
|
||||||
resize () {
|
resize () {
|
||||||
this.width = this.el.offsetWidth
|
if (this.renderer) {
|
||||||
this.height = this.el.offsetHeight
|
this.width = this.el.offsetWidth
|
||||||
this.renderer.setSize(this.width, this.height)
|
this.height = this.el.offsetHeight
|
||||||
this.camera.perspective({
|
this.renderer.setSize(this.width, this.height)
|
||||||
aspect: this.gl.canvas.width / this.gl.canvas.height
|
this.camera.perspective({
|
||||||
})
|
aspect: this.gl.canvas.width / this.gl.canvas.height
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user