Fix potential off-by-one

This commit is contained in:
elasota
2020-01-21 00:21:11 -05:00
parent 5e3e666765
commit 06243e4d45

View File

@@ -418,7 +418,7 @@ namespace PortabilityLayer
// Since the algorithm here is based on cost minimization, it is allowed to intersect the ellipse if the start and end points
// are both on or outside of the ellipse, so this violates the invariants.
// Therefore, we need to decrement X until this is not the case.
while (m_xChangeCostDynamicFactor - m_xChangeCostStaticFactor < m_sqDistFromEdge)
while (m_xChangeCostDynamicFactor - m_xChangeCostStaticFactor <= m_sqDistFromEdge)
DecrementX();
}
}