Eeschema: Add collision-based selection code to circles and text
This commit is contained in:
parent
47f37efdec
commit
f685cfaf3d
|
@ -146,11 +146,8 @@ void LIB_CIRCLE::SetOffset( const wxPoint& aOffset )
|
|||
|
||||
bool LIB_CIRCLE::Inside( EDA_RECT& aRect ) const
|
||||
{
|
||||
/*
|
||||
* FIXME: This fails to take into account the radius around the center
|
||||
* point.
|
||||
*/
|
||||
return aRect.Contains( m_Pos.x, -m_Pos.y );
|
||||
wxPoint center(m_Pos.x, -m_Pos.y);
|
||||
return aRect.IntersectsCircle( center, m_Radius );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -447,11 +447,7 @@ void LIB_FIELD::SetOffset( const wxPoint& aOffset )
|
|||
|
||||
bool LIB_FIELD::Inside( EDA_RECT& rect ) const
|
||||
{
|
||||
/*
|
||||
* FIXME: This fails to take into account the size and/or orientation of
|
||||
* the text.
|
||||
*/
|
||||
return rect.Contains( GetTextPos().x, -GetTextPos().y );
|
||||
return rect.Intersects( GetBoundingBox() );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -268,11 +268,7 @@ void LIB_TEXT::SetOffset( const wxPoint& aOffset )
|
|||
|
||||
bool LIB_TEXT::Inside( EDA_RECT& rect ) const
|
||||
{
|
||||
/*
|
||||
* FIXME: This should calculate the text size and justification and
|
||||
* use rectangle intersect.
|
||||
*/
|
||||
return rect.Contains( GetTextPos().x, -GetTextPos().y );
|
||||
return rect.Intersects( GetBoundingBox() );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue