Update resize method and debounce it on component

This commit is contained in:
2022-07-19 12:36:51 +02:00
parent 543d2e5c8b
commit fa056d0933
2 changed files with 5 additions and 3 deletions

View File

@@ -210,6 +210,8 @@ export class Globe {
*/
resize () {
// this.renderer.setSize(window.innerWidth, window.innerHeight)
this.width = this.el.offsetWidth
this.height = this.el.offsetHeight
this.renderer.setSize(this.width, this.height)
this.camera.perspective({
aspect: this.gl.canvas.width / this.gl.canvas.height