Commit supplementing 9605dd8e
Once SELECTION_TOOL has been changed to use EDA_ITEM::GetBoundingBox(), selection area had to cover the footprint and its ref/value texts, even hidden ones. To fix this, ref/val strings are taken into account only in the ViewBBox().
This commit is contained in:
parent
e624bbae8a
commit
72b49acccf
|
@ -493,23 +493,7 @@ EDA_RECT MODULE::GetFootprintRect() const
|
||||||
|
|
||||||
const EDA_RECT MODULE::GetBoundingBox() const
|
const EDA_RECT MODULE::GetBoundingBox() const
|
||||||
{
|
{
|
||||||
EDA_RECT area = GetFootprintRect();
|
return GetFootprintRect();
|
||||||
|
|
||||||
// Calculate extended area including text fields
|
|
||||||
area.Merge( m_Reference->GetBoundingBox() );
|
|
||||||
area.Merge( m_Value->GetBoundingBox() );
|
|
||||||
|
|
||||||
// Add the Clearance shape size: (shape around the pads when the
|
|
||||||
// clearance is shown. Not optimized, but the draw cost is small
|
|
||||||
// (perhaps smaller than optimization).
|
|
||||||
BOARD* board = GetBoard();
|
|
||||||
if( board )
|
|
||||||
{
|
|
||||||
int biggest_clearance = board->GetDesignSettings().GetBiggestClearanceValue();
|
|
||||||
area.Inflate( biggest_clearance );
|
|
||||||
}
|
|
||||||
|
|
||||||
return area;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1016,9 +1000,24 @@ unsigned int MODULE::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
|
||||||
|
|
||||||
const BOX2I MODULE::ViewBBox() const
|
const BOX2I MODULE::ViewBBox() const
|
||||||
{
|
{
|
||||||
EDA_RECT fpRect = GetFootprintRect();
|
EDA_RECT area = GetFootprintRect();
|
||||||
|
|
||||||
return BOX2I( VECTOR2I( fpRect.GetOrigin() ), VECTOR2I( fpRect.GetSize() ) );
|
// Calculate extended area including text fields
|
||||||
|
area.Merge( m_Reference->GetBoundingBox() );
|
||||||
|
area.Merge( m_Value->GetBoundingBox() );
|
||||||
|
|
||||||
|
// Add the Clearance shape size: (shape around the pads when the
|
||||||
|
// clearance is shown. Not optimized, but the draw cost is small
|
||||||
|
// (perhaps smaller than optimization).
|
||||||
|
BOARD* board = GetBoard();
|
||||||
|
if( board )
|
||||||
|
{
|
||||||
|
int biggest_clearance = board->GetDesignSettings().GetBiggestClearanceValue();
|
||||||
|
area.Inflate( biggest_clearance );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return BOX2I( area );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue