From b5e9a949bc1ef8fc7b1bb6ae23dcde3eb903a88e Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Thu, 28 Jan 2021 19:51:29 -0500 Subject: [PATCH] Selection: skip sloppiness pruning if invalid Fixes https://gitlab.com/kicad/code/kicad/-/issues/7320 --- pcbnew/tools/pcb_selection_tool.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index 1d40e9bf35..30719aac84 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -2374,10 +2374,13 @@ void PCB_SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector // Prune sloppier items - for( std::pair pair : itemsBySloppiness ) + if( minSlop < INT_MAX ) { - if( pair.second > minSlop + pixel ) - aCollector.Transfer( pair.first ); + for( std::pair pair : itemsBySloppiness ) + { + if( pair.second > minSlop + pixel ) + aCollector.Transfer( pair.first ); + } } // If the user clicked on a small item within a much larger one then it's pretty clear