Commit a7b916d6 authored by unknown's avatar unknown Committed by jean-pierre charras
Browse files

Eeschema: Fix Bug #983251 (Eeschema mouse hit testing error on non horizontal or vertical wires)

parent 86b39ca3
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -571,17 +571,18 @@ bool SCH_LINE::HitTest( const wxPoint& aPosition, int aAccuracy ) const

bool SCH_LINE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const
{
    if( m_Flags & STRUCT_DELETED || m_Flags & SKIP_STRUCT )
    if( m_Flags & ( STRUCT_DELETED | SKIP_STRUCT ) )
        return false;

    EDA_RECT rect = aRect;

    if ( aAccuracy )
    	rect.Inflate( aAccuracy );

    if( aContained )
        return rect.Contains( GetBoundingBox() );
        return rect.Contains( m_start ) && rect.Contains( m_end );

    return rect.Intersects( GetBoundingBox() );
    return rect.Intersects( m_start, m_end );
}