Avoid int overflow in collisions

When calculating arc collisions, avoid overflowing the integer distance,
which gives a false nearest point
This commit is contained in:
Seth Hillbrand 2024-05-20 15:00:33 -07:00
parent f75e6dae84
commit 0a227ea916
1 changed files with 1 additions and 1 deletions

View File

@ -656,7 +656,7 @@ bool SHAPE_LINE_CHAIN::Collide( const SEG& aSeg, int aClearance, int* aActual,
}
int dist = 0;
int closest_dist = sqrt( closest_dist_sq );
SEG::ecoord closest_dist = sqrt( closest_dist_sq );
// Collide arc segments
for( size_t i = 0; i < ArcCount(); i++ )