diff --git a/eeschema/lib_pin.cpp b/eeschema/lib_pin.cpp index e73a352898..2e8902d4d7 100644 --- a/eeschema/lib_pin.cpp +++ b/eeschema/lib_pin.cpp @@ -562,6 +562,23 @@ bool LIB_PIN::HitTest( const wxPoint& aPosition, int aAccuracy ) const } +bool LIB_PIN::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const +{ + if( m_Flags & ( STRUCT_DELETED | SKIP_STRUCT ) ) + return false; + + EDA_RECT sel = aRect; + + if ( aAccuracy ) + sel.Inflate( aAccuracy ); + + if( aContained ) + return sel.Contains( GetBoundingBox( false, true ) ); + + return sel.Intersects( GetBoundingBox( false, true ) ); +} + + int LIB_PIN::GetPenWidth() const { return std::max( m_width, 1 ); @@ -1352,6 +1369,7 @@ void LIB_PIN::MirrorHorizontal( const wxPoint& center ) m_orientation = PIN_RIGHT; } + void LIB_PIN::MirrorVertical( const wxPoint& center ) { m_position.y -= center.y; @@ -1364,6 +1382,7 @@ void LIB_PIN::MirrorVertical( const wxPoint& center ) m_orientation = PIN_UP; } + void LIB_PIN::Rotate( const wxPoint& center, bool aRotateCCW ) { int rot_angle = aRotateCCW ? -900 : 900; @@ -1496,7 +1515,7 @@ void LIB_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) override; /** @@ -133,7 +135,7 @@ public: * @param aIncludeInvisibles - if false, do not include labels for invisible pins * in the calculation. */ - const EDA_RECT GetBoundingBox( bool aIncludeInvisibles ) const; + const EDA_RECT GetBoundingBox( bool aIncludeInvisibles, bool aPinOnly = false ) const; /** * @return The pin end position for a component in the normal orientation.