Improve handling of long distances
This commit is contained in:
parent
b81a3f0533
commit
6d739ca9da
|
@ -705,7 +705,7 @@ bool EDA_SHAPE::hitTest( const VECTOR2I& aPosition, int aAccuracy ) const
|
||||||
case SHAPE_T::CIRCLE:
|
case SHAPE_T::CIRCLE:
|
||||||
{
|
{
|
||||||
int radius = GetRadius();
|
int radius = GetRadius();
|
||||||
int dist = KiROUND( EuclideanNorm( aPosition - getCenter() ) );
|
long dist = KiROUND<double, long>( EuclideanNorm( aPosition - getCenter() ) );
|
||||||
|
|
||||||
if( IsFilled() )
|
if( IsFilled() )
|
||||||
return dist <= radius + maxdist; // Filled circle hit-test
|
return dist <= radius + maxdist; // Filled circle hit-test
|
||||||
|
@ -723,7 +723,7 @@ bool EDA_SHAPE::hitTest( const VECTOR2I& aPosition, int aAccuracy ) const
|
||||||
|
|
||||||
VECTOR2I relPos = aPosition - getCenter();
|
VECTOR2I relPos = aPosition - getCenter();
|
||||||
int radius = GetRadius();
|
int radius = GetRadius();
|
||||||
int dist = KiROUND( EuclideanNorm( relPos ) );
|
long dist = KiROUND<double, long>( EuclideanNorm( relPos ) );
|
||||||
|
|
||||||
if( IsFilled() )
|
if( IsFilled() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -62,9 +62,9 @@ void TWO_POINT_ASSISTANT::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
|
||||||
if( m_constructMan.IsReset() )
|
if( m_constructMan.IsReset() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const VECTOR2I origin = m_constructMan.GetOrigin();
|
const VECTOR2I origin = m_constructMan.GetOrigin();
|
||||||
const VECTOR2I end = m_constructMan.GetEnd();
|
const VECTOR2I end = m_constructMan.GetEnd();
|
||||||
const VECTOR2I radVec = end - origin;
|
const VECTOR2D radVec = end - origin;
|
||||||
|
|
||||||
// Ensures that +90° is up and -90° is down in pcbnew
|
// Ensures that +90° is up and -90° is down in pcbnew
|
||||||
const EDA_ANGLE deltaAngle( VECTOR2I( radVec.x, -radVec.y ) );
|
const EDA_ANGLE deltaAngle( VECTOR2I( radVec.x, -radVec.y ) );
|
||||||
|
|
Loading…
Reference in New Issue