From 4b38bd1543bf0aeb4e202a9126e351012d846497 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 23 Sep 2021 22:13:32 +0100 Subject: [PATCH] Favour junction dots to wires inside the dot. Fixes https://gitlab.com/kicad/code/kicad/issues/9187 --- eeschema/tools/ee_selection_tool.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index 1c5b80c4c2..c00b3b56b7 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -1022,10 +1023,13 @@ void EE_SELECTION_TOOL::GuessSelectionCandidates( EE_COLLECTOR& collector, const if( exactHits.count( item ) ) { - wxPoint pos( aPos ); - SCH_LINE* line = dynamic_cast( item ); + wxPoint pos( aPos ); + SCH_LINE* line = dynamic_cast( item ); + SCH_JUNCTION* junction = dynamic_cast( item ); - if( line ) + if( junction ) + dist = 0; // Hits *inside* a junction dot should select the dot + else if( line ) dist = DistanceLinePoint( line->GetStartPoint(), line->GetEndPoint(), pos ); else dist = EuclideanNorm( bbox.GetCenter() - pos ) * 2;