fix epsilon bug (#1025)

This commit is contained in:
Kurt Hutten
2023-11-08 20:27:53 +11:00
committed by GitHub
parent acbfae2e65
commit a0678d22a8

View File

@ -946,7 +946,7 @@ export function compareVec2Epsilon(
) { ) {
const compareEpsilon = 0.015625 // or 2^-6 const compareEpsilon = 0.015625 // or 2^-6
const xDifference = Math.abs(vec1[0] - vec2[0]) const xDifference = Math.abs(vec1[0] - vec2[0])
const yDifference = Math.abs(vec1[0] - vec2[0]) const yDifference = Math.abs(vec1[1] - vec2[1])
return xDifference < compareEpsilon && yDifference < compareEpsilon return xDifference < compareEpsilon && yDifference < compareEpsilon
} }