pcbnew: Fix Footprint selection to only footprint area
Fixes: lp:1796866 * https://bugs.launchpad.net/kicad/+bug/1796866
This commit is contained in:
parent
4e06494105
commit
246f49b8cb
|
@ -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 )
|
SELECTION& SELECTION_TOOL::RequestSelection( CLIENT_SELECTION_FILTER aClientFilter )
|
||||||
{
|
{
|
||||||
bool selectionEmpty = m_selection.Empty();
|
bool selectionEmpty = m_selection.Empty();
|
||||||
|
@ -650,7 +659,7 @@ bool SELECTION_TOOL::selectMultiple()
|
||||||
|
|
||||||
if( windowSelection )
|
if( windowSelection )
|
||||||
{
|
{
|
||||||
BOX2I bbox = item->GetBoundingBox();
|
BOX2I bbox = getRect( item );
|
||||||
|
|
||||||
if( selectionBox.Contains( bbox ) )
|
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 )
|
static double calcArea( const BOARD_ITEM* aItem )
|
||||||
{
|
{
|
||||||
if( aItem->Type() == PCB_TRACE_T )
|
if( aItem->Type() == PCB_TRACE_T )
|
||||||
|
|
Loading…
Reference in New Issue