From d7e94110494e2dfaa6c0b10937dd4de4ac9ba6f5 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sat, 12 Sep 2020 13:16:10 -0400 Subject: [PATCH] Filter out footprints that are larger than the viewport in either direction Fixes https://gitlab.com/kicad/code/kicad/-/issues/2448 --- pcbnew/tools/selection_tool.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index d6000a5393..fb513d3025 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -2398,7 +2398,8 @@ void SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector, if( MODULE* mod = dyn_cast( aCollector[i] ) ) { // filter out components larger than the viewport - if( mod->ViewBBox().Contains( viewport ) ) + if( mod->ViewBBox().GetHeight() > viewport.GetHeight() || + mod->ViewBBox().GetWidth() > viewport.GetWidth() ) rejected.insert( mod ); // footprints completely covered with other features have no other // means of selection, so must be kept