diff --git a/common/eda_shape.cpp b/common/eda_shape.cpp index 636add5293..b0e7a793fd 100644 --- a/common/eda_shape.cpp +++ b/common/eda_shape.cpp @@ -881,7 +881,7 @@ bool EDA_SHAPE::hitTest( const VECTOR2I& aPosition, int aAccuracy ) const double radius = GetRadius(); double dist = aPosition.Distance( getCenter() ); - if( IsFilled() ) + if( IsFilledForHitTesting() ) return dist <= radius + maxdist; // Filled circle hit-test else return abs( radius - dist ) <= maxdist; // Ring hit-test @@ -899,7 +899,7 @@ bool EDA_SHAPE::hitTest( const VECTOR2I& aPosition, int aAccuracy ) const VECTOR2D relPos( VECTOR2D( aPosition ) - getCenter() ); double dist = relPos.EuclideanNorm(); - if( IsFilled() ) + if( IsFilledForHitTesting() ) { // Check distance from arc center if( dist > radius + maxdist ) @@ -944,7 +944,7 @@ bool EDA_SHAPE::hitTest( const VECTOR2I& aPosition, int aAccuracy ) const return TestSegmentHit( aPosition, GetStart(), GetEnd(), maxdist ); case SHAPE_T::RECTANGLE: - if( IsProxyItem() || IsFilled() ) // Filled rect hit-test + if( IsProxyItem() || IsFilledForHitTesting() ) // Filled rect hit-test { SHAPE_POLY_SET poly; poly.NewOutline(); @@ -965,7 +965,7 @@ bool EDA_SHAPE::hitTest( const VECTOR2I& aPosition, int aAccuracy ) const } case SHAPE_T::POLY: - if( IsFilled() ) + if( IsFilledForHitTesting() ) { if( !m_poly.COutline( 0 ).IsClosed() ) { diff --git a/eeschema/sch_rule_area.h b/eeschema/sch_rule_area.h index d8c4d9a48e..67c5b3c678 100644 --- a/eeschema/sch_rule_area.h +++ b/eeschema/sch_rule_area.h @@ -57,6 +57,11 @@ public: void ViewGetLayers( int aLayers[], int& aCount ) const override; + bool IsFilledForHitTesting() const override + { + return false; + } + virtual std::vector MakeEffectiveShapes( bool aEdgeOnly = false ) const override; virtual void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts, diff --git a/include/eda_shape.h b/include/eda_shape.h index 1a7e898965..7b866892d0 100644 --- a/include/eda_shape.h +++ b/include/eda_shape.h @@ -93,6 +93,11 @@ public: return GetFillMode() != FILL_T::NO_FILL; } + virtual bool IsFilledForHitTesting() const + { + return IsFilled(); + } + void SetFilled( bool aFlag ) { setFilled( aFlag );