From 5348f88a8ffd8d6944a227e9f1410eb19f09521a Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 27 Aug 2019 21:08:09 +0100 Subject: [PATCH] Add sheet pins to candidate list by hand (as they're not in the view). Fixes: lp:1841555 * https://bugs.launchpad.net/kicad/+bug/1841555 --- eeschema/tools/ee_selection_tool.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index c21443ccb6..e23ef1ede7 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -695,6 +695,19 @@ bool EE_SELECTION_TOOL::selectMultiple() BOX2I selectionBox = area.ViewBBox(); view->Query( selectionBox, selectedItems ); // Get the list of selected items + // Sheet pins aren't in the view; add them by hand + for( KIGFX::VIEW::LAYER_ITEM_PAIR& pair : selectedItems ) + { + if( static_cast( pair.first )->Type() == SCH_SHEET_T ) + { + SCH_SHEET* sheet = (SCH_SHEET*) pair.first; + int layer = pair.second; + + for( SCH_SHEET_PIN& pin : sheet->GetPins() ) + selectedItems.emplace_back( KIGFX::VIEW::LAYER_ITEM_PAIR( &pin, layer ) ); + } + } + std::vector::iterator it, it_end; int width = area.GetEnd().x - area.GetOrigin().x;