Skip to content

Commit 1aac02b

Browse files
Fix window scaling #45 (#63)
* fix scaling when window resized * Prettify --------- Co-authored-by: Isabel Paredes <isabel.paredes@quantstack.net>
1 parent db28edc commit 1aac02b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/renderer.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ export class URDFRenderer extends THREE.WebGLRenderer {
230230
* Refreshes the viewer by re-rendering the scene and its elements
231231
*/
232232
redraw(): void {
233+
const renderSize = this.getSize(new THREE.Vector2());
234+
this._camera.aspect = renderSize.width / renderSize.height;
235+
this._camera.updateProjectionMatrix();
233236
this.render(this._scene, this._camera);
234237
}
235238
}

0 commit comments

Comments
 (0)