Restore PointCloserThan() behaviour to really be "closer than".
Change calls which really want it to be "closer than or equal" to distance + 1. Fixes: lp:1843329 * https://bugs.launchpad.net/kicad/+bug/1843329
This commit is contained in:
parent
1a375a1e71
commit
25fa2131d2
|
@ -40,9 +40,9 @@ bool SEG::PointCloserThan( const VECTOR2I& aP, int aDist ) const
|
|||
SEG::ecoord t = d.Dot( aP - A );
|
||||
|
||||
if( t <= 0 || !l_squared )
|
||||
return ( aP - A ).SquaredEuclideanNorm() <= dist_sq;
|
||||
return ( aP - A ).SquaredEuclideanNorm() < dist_sq;
|
||||
else if( t >= l_squared )
|
||||
return ( aP - B ).SquaredEuclideanNorm() <= dist_sq;
|
||||
return ( aP - B ).SquaredEuclideanNorm() < dist_sq;
|
||||
|
||||
int dxdy = abs( d.x ) - abs( d.y );
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ bool TestSegmentHit( const wxPoint &aRefPoint, wxPoint aStart, wxPoint aEnd, int
|
|||
return std::abs( delta.y ) <= aDist;
|
||||
|
||||
SEG segment( aStart, aEnd );
|
||||
return segment.PointCloserThan( aRefPoint, aDist );
|
||||
return segment.PointCloserThan( aRefPoint, aDist + 1 );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue