Updated HitTest for PCB_TEXT and TEXT_MOD
This commit is contained in:
parent
e29abd6204
commit
6aadc703f0
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue