diff --git a/app/javascript/src/preview.ts b/app/javascript/src/preview.ts index e9dd7cf6c..4bad80562 100644 --- a/app/javascript/src/preview.ts +++ b/app/javascript/src/preview.ts @@ -21,8 +21,9 @@ class ObjectPreview { setup (): void { this.scene = new THREE.Scene() this.renderer = new THREE.WebGLRenderer({ canvas: this.canvas }) - this.camera = new THREE.PerspectiveCamera(45, this.canvas.width / this.canvas.height, 0.1, 1000) + this.camera = new THREE.PerspectiveCamera(45, this.canvas.clientWidth / this.canvas.clientHeight, 0.1, 1000) this.camera.position.z = 50 + this.renderer.setSize(this.canvas.clientWidth, this.canvas.clientHeight, false) this.controls = new OrbitControls(this.camera, this.renderer.domElement) this.controls.enableDamping = true this.controls.enablePan = false