浏览代码

tweak, use Box3D.size

Alexander Rose 5 年之前
父节点
当前提交
8b766dc242
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/mol-math/geometry/lookup3d/grid.ts

+ 1 - 1
src/mol-math/geometry/lookup3d/grid.ts

@@ -192,7 +192,7 @@ function build(data: PositionData, cellSizeOrCount?: Vec3 | number) {
     const expandedBox = Box3D.expand(Box3D.empty(), boundingBox, Vec3.create(0.5, 0.5, 0.5));
     const { indices } = data;
 
-    const S = Vec3.sub(Vec3.zero(), expandedBox.max, expandedBox.min);
+    const S = Box3D.size(Vec3.zero(), expandedBox);
     let delta, size;
 
     const elementCount = OrderedSet.size(indices);