Updated HitTest for PCB_TEXT and TEXT_MOD

This commit is contained in:
Oliver Walters 2017-04-26 22:38:41 +10:00 committed by Maciej Suminski
parent e29abd6204
commit 6aadc703f0
3 changed files with 11 additions and 22 deletions

View File

@ -81,7 +81,7 @@ public:
void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ) override;
bool HitTest( const wxPoint& aPosition ) const override
virtual bool HitTest( const wxPoint& aPosition ) const override
{
return TextHitTest( aPosition );
}
@ -89,7 +89,7 @@ public:
/** @copydoc BOARD_ITEM::HitTest(const EDA_RECT& aRect,
* bool aContained = true, int aAccuracy ) const
*/
bool HitTest( const EDA_RECT& aRect, bool aContained = true, int aAccuracy = 0 ) const override
virtual bool HitTest( const EDA_RECT& aRect, bool aContained = true, int aAccuracy = 0 ) const override
{
return TextHitTest( aRect, aContained, aAccuracy );
}

View File

@ -181,25 +181,6 @@ void TEXTE_MODULE::SetLocalCoord()
}
}
bool TEXTE_MODULE::HitTest( const wxPoint& aPosition ) const
{
wxPoint rel_pos;
EDA_RECT area = GetTextBox( -1, -1 );
/* Rotate refPos to - angle to test if refPos is within area (which
* is relative to an horizontal text)
*/
rel_pos = aPosition;
RotatePoint( &rel_pos, GetTextPos(), -GetDrawRotation() );
if( area.Contains( rel_pos ) )
return true;
return false;
}
const EDA_RECT TEXTE_MODULE::GetBoundingBox() const
{
double angle = GetDrawRotation();

View File

@ -184,7 +184,15 @@ public:
void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ) override;
bool HitTest( const wxPoint& aPosition ) const override;
virtual bool HitTest( const wxPoint& aPosition ) const override
{
return TextHitTest( aPosition );
}
virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false, int aAccuracy = 0 ) const override
{
return TextHitTest( aRect, aContained, aAccuracy );
}
wxString GetClass() const override
{