diff --git a/eeschema/lib_circle.cpp b/eeschema/lib_circle.cpp index 78a915325c..18ecfb000c 100644 --- a/eeschema/lib_circle.cpp +++ b/eeschema/lib_circle.cpp @@ -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 ); } diff --git a/eeschema/lib_field.cpp b/eeschema/lib_field.cpp index cd7e524b68..26237bdf14 100644 --- a/eeschema/lib_field.cpp +++ b/eeschema/lib_field.cpp @@ -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() ); } diff --git a/eeschema/lib_text.cpp b/eeschema/lib_text.cpp index 428a28d0f4..d07f30533e 100644 --- a/eeschema/lib_text.cpp +++ b/eeschema/lib_text.cpp @@ -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() ); }