From 246f49b8cbab483365e061a280180c9d5fd490f4 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Tue, 9 Oct 2018 05:52:56 -0700 Subject: [PATCH] pcbnew: Fix Footprint selection to only footprint area Fixes: lp:1796866 * https://bugs.launchpad.net/kicad/+bug/1796866 --- pcbnew/tools/selection_tool.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index 60868a5dcc..01233e18cb 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -399,6 +399,15 @@ SELECTION& SELECTION_TOOL::GetSelection() } +static EDA_RECT getRect( const BOARD_ITEM* aItem ) +{ + if( aItem->Type() == PCB_MODULE_T ) + return static_cast( aItem )->GetFootprintRect(); + + return aItem->GetBoundingBox(); +} + + SELECTION& SELECTION_TOOL::RequestSelection( CLIENT_SELECTION_FILTER aClientFilter ) { bool selectionEmpty = m_selection.Empty(); @@ -650,7 +659,7 @@ bool SELECTION_TOOL::selectMultiple() if( windowSelection ) { - BOX2I bbox = item->GetBoundingBox(); + BOX2I bbox = getRect( item ); if( selectionBox.Contains( bbox ) ) { @@ -1908,15 +1917,6 @@ bool SELECTION_TOOL::selectionContains( const VECTOR2I& aPoint ) const } -static EDA_RECT getRect( const BOARD_ITEM* aItem ) -{ - if( aItem->Type() == PCB_MODULE_T ) - return static_cast( aItem )->GetFootprintRect(); - - return aItem->GetBoundingBox(); -} - - static double calcArea( const BOARD_ITEM* aItem ) { if( aItem->Type() == PCB_TRACE_T )