Browse Source

fix camera.near for small molecules

David Sehnal 4 năm trước cách đây
mục cha
commit
7aafb2f4c3
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/mol-canvas3d/camera.ts

+ 1 - 1
src/mol-canvas3d/camera.ts

@@ -320,7 +320,7 @@ function updateClip(camera: Camera) {
 
 
     if (mode === 'perspective') {
     if (mode === 'perspective') {
         // set at least to 5 to avoid slow sphere impostor rendering
         // set at least to 5 to avoid slow sphere impostor rendering
-        near = Math.max(5, near);
+        near = Math.max(Math.min(radius, 5), near);
         far = Math.max(5, far);
         far = Math.max(5, far);
     } else {
     } else {
         near = Math.max(0, near);
         near = Math.max(0, near);