bool LIB_TEXT::HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform ) { if( aThreshold < 0 ) aThreshold = 0; wxPoint physicalpos = aTransform.TransformCoordinate( m_Pos ); wxPoint tmp = m_Pos; m_Pos = physicalpos; /* The text orientation may need to be flipped if the * transformation matrix causes xy axes to be flipped. * this simple algo works only for schematic matrix (rot 90 or/and mirror) */ int t1 = ( aTransform.x1 != 0 ) ^ ( m_Orient != 0 ); int orient = t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT; EXCHG( m_Orient, orient ); bool hit = TextHitTest( aPosition ); EXCHG( m_Orient, orient ); m_Pos = tmp; return hit; }
bool SCH_TEXT::HitTest( const wxPoint& aPosition, int aAccuracy ) const { return TextHitTest( aPosition, aAccuracy ); }
bool SCH_TEXT::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const { return TextHitTest( aRect, aContained, aAccuracy ); }
bool SCH_GLOBALLABEL::HitTest( const wxPoint& aPosition, int aAccuracy ) const { return TextHitTest( aPosition, aAccuracy ); }