Browse Source

Fine-tuning diamon intersections

Mark Tolmacs 5 months ago
parent
commit
946d3ddf87
1 changed files with 2 additions and 1 deletions
  1. 2 1
      packages/element/src/collision.ts

+ 2 - 1
packages/element/src/collision.ts

@@ -287,7 +287,8 @@ const intersectDiamondWithLineSegment = (
     ]
       // Remove duplicates
       .filter(
-        (p, idx, points) => points.findIndex((d) => pointsEqual(p, d)) === idx,
+        (p, idx, points) =>
+          points.findIndex((d) => pointsEqual(p, d, 1e-3)) === idx,
       )
   );
 };