Explorar o código

Camera: fix "non-invertible-matrix" error when clearing state

David Sehnal %!s(int64=4) %!d(string=hai) anos
pai
achega
3cf1c64e12
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/mol-canvas3d/camera.ts

+ 4 - 0
src/mol-canvas3d/camera.ts

@@ -67,6 +67,10 @@ class Camera implements ICamera {
 
     update() {
         const snapshot = this.state as Camera.Snapshot;
+        if (snapshot.radiusMax === 0) {
+            return false;
+        }
+
         const height = 2 * Math.tan(snapshot.fov / 2) * Vec3.distance(snapshot.position, snapshot.target);
         this.zoom = this.viewport.height / height;