diff --git a/eeschema/sch_pin.cpp b/eeschema/sch_pin.cpp index 19f044395b..505da44878 100644 --- a/eeschema/sch_pin.cpp +++ b/eeschema/sch_pin.cpp @@ -317,6 +317,10 @@ const EDA_RECT SCH_PIN::GetBoundingBox() const bool SCH_PIN::HitTest( const wxPoint& aPosition, int aAccuracy ) const { + // When looking for an "exact" hit aAccuracy will be 0 which works poorly if the pin has + // no pin number or name. Give it a floor. + aAccuracy = std::max( aAccuracy, GetPenWidth() ); + EDA_RECT rect = GetBoundingBox(); return rect.Inflate( aAccuracy ).Contains( aPosition ); } diff --git a/pcbnew/zone.cpp b/pcbnew/zone.cpp index 26fcaff94b..3a1918bf4b 100644 --- a/pcbnew/zone.cpp +++ b/pcbnew/zone.cpp @@ -399,8 +399,8 @@ void ZONE::BuildHashValue( PCB_LAYER_ID aLayer ) bool ZONE::HitTest( const wxPoint& aPosition, int aAccuracy ) const { - // Normally accuracy is zoom-relative, but at high zooms zones can be too hard to select - // so we provide a minimum. + // When looking for an "exact" hit aAccuracy will be 0 which works poorly for very thin + // lines. Give it a floor. int accuracy = std::max( aAccuracy, Millimeter2iu( 0.1 ) ); return HitTestForCorner( aPosition, accuracy * 2 ) || HitTestForEdge( aPosition, accuracy );