pcbnew: Fix Footprint selection to only footprint area

Fixes: lp:1796866
* https://bugs.launchpad.net/kicad/+bug/1796866
This commit is contained in:
Seth Hillbrand 2018-10-09 05:52:56 -07:00
parent 4e06494105
commit 246f49b8cb
1 changed files with 10 additions and 10 deletions

View File

@ -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<const MODULE*>( 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<const MODULE*>( aItem )->GetFootprintRect();
return aItem->GetBoundingBox();
}
static double calcArea( const BOARD_ITEM* aItem )
{
if( aItem->Type() == PCB_TRACE_T )