fix minor interp bug

This commit is contained in:
Kae 2024-03-17 18:06:12 +11:00
parent 758a900e51
commit faae6e715a

View File

@ -29,7 +29,7 @@ function<float(float, float, float)> WorldGeometry::xLerpFunction(Maybe<float> d
unsigned xsize = m_size[0];
return [discontinuityThreshold, xsize](float offset, float min, float max) -> float {
float distance = wrapDiffF<float>(max, min, xsize);
if (discontinuityThreshold && distance > *discontinuityThreshold)
if (discontinuityThreshold && abs(distance) > *discontinuityThreshold)
return min + distance;
return min + offset * distance;
};