Use pin graphic only for rubber-band selection hit-testing.
Fixes https://gitlab.com/kicad/code/kicad/issues/4138
This commit is contained in:
parent
d34f8fd4b5
commit
dd61f6f019
eeschema
|
@ -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<MSG_PANEL_ITE
|
|||
#endif
|
||||
}
|
||||
|
||||
const EDA_RECT LIB_PIN::GetBoundingBox( bool aIncludeInvisibles ) const
|
||||
const EDA_RECT LIB_PIN::GetBoundingBox( bool aIncludeInvisibles, bool aPinOnly ) const
|
||||
{
|
||||
EDA_RECT bbox;
|
||||
wxPoint begin;
|
||||
|
@ -1520,6 +1539,12 @@ const EDA_RECT LIB_PIN::GetBoundingBox( bool aIncludeInvisibles ) const
|
|||
showNum = false;
|
||||
}
|
||||
|
||||
if( aPinOnly )
|
||||
{
|
||||
showName = false;
|
||||
showNum = false;
|
||||
}
|
||||
|
||||
// First, calculate boundary box corners position
|
||||
int numberTextLength = showNum ? m_numTextSize * m_number.Len() : 0;
|
||||
|
||||
|
|
|
@ -113,6 +113,8 @@ public:
|
|||
|
||||
bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
|
||||
|
||||
bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
|
||||
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& 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.
|
||||
|
|
Loading…
Reference in New Issue