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:
parent
f75e6dae84
commit
0a227ea916
|
@ -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++ )
|
||||
|
|
Loading…
Reference in New Issue