Add missing rect hittest
This commit is contained in:
parent
2a088e5c7b
commit
db394286c7
|
@ -254,6 +254,23 @@ bool LIB_RECTANGLE::HitTest( const wxPoint& aPosition, int aAccuracy ) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool LIB_RECTANGLE::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() );
|
||||||
|
|
||||||
|
return sel.Intersects( GetBoundingBox() );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
wxString LIB_RECTANGLE::GetSelectMenuText( EDA_UNITS aUnits ) const
|
wxString LIB_RECTANGLE::GetSelectMenuText( EDA_UNITS aUnits ) const
|
||||||
{
|
{
|
||||||
return wxString::Format( _( "Rectangle, width %s height %s" ),
|
return wxString::Format( _( "Rectangle, width %s height %s" ),
|
||||||
|
|
|
@ -58,6 +58,8 @@ public:
|
||||||
|
|
||||||
bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
|
bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
|
||||||
|
|
||||||
|
bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
|
||||||
|
|
||||||
int GetPenWidth() const override;
|
int GetPenWidth() const override;
|
||||||
|
|
||||||
const EDA_RECT GetBoundingBox() const override;
|
const EDA_RECT GetBoundingBox() const override;
|
||||||
|
|
Loading…
Reference in New Issue