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 )