Only add ref & value to boundingBox if they're visible.
Fixes: lp:1746911 * https://bugs.launchpad.net/kicad/+bug/1746911
This commit is contained in:
parent
bb8096497a
commit
375e8a2f97
|
@ -51,7 +51,7 @@
|
||||||
#include <class_drawsegment.h>
|
#include <class_drawsegment.h>
|
||||||
#include <class_pcb_target.h>
|
#include <class_pcb_target.h>
|
||||||
#include <connectivity/connectivity_data.h>
|
#include <connectivity/connectivity_data.h>
|
||||||
|
#include <pgm_base.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A singleton item of this class is returned for a weak reference that no longer exists.
|
* A singleton item of this class is returned for a weak reference that no longer exists.
|
||||||
|
@ -779,7 +779,8 @@ unsigned BOARD::GetUnconnectedNetCount() const
|
||||||
EDA_RECT BOARD::ComputeBoundingBox( bool aBoardEdgesOnly ) const
|
EDA_RECT BOARD::ComputeBoundingBox( bool aBoardEdgesOnly ) const
|
||||||
{
|
{
|
||||||
EDA_RECT area;
|
EDA_RECT area;
|
||||||
LSET visible = GetVisibleLayers();
|
LSET visible = GetVisibleLayers();
|
||||||
|
bool showInvisibleText = IsElementVisible( LAYER_MOD_TEXT_INVISIBLE ) && !Pgm().m_Printing;
|
||||||
|
|
||||||
// Check segments, dimensions, texts, and fiducials
|
// Check segments, dimensions, texts, and fiducials
|
||||||
for( auto item : m_drawings )
|
for( auto item : m_drawings )
|
||||||
|
@ -807,7 +808,7 @@ EDA_RECT BOARD::ComputeBoundingBox( bool aBoardEdgesOnly ) const
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
area.Merge( module->GetBoundingBox() );
|
area.Merge( module->GetBoundingBox( showInvisibleText ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -407,6 +407,27 @@ const EDA_RECT MODULE::GetBoundingBox() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const EDA_RECT MODULE::GetBoundingBox( bool aIncludeInvisibleText ) const
|
||||||
|
{
|
||||||
|
EDA_RECT area = GetFootprintRect();
|
||||||
|
|
||||||
|
// Add in items not collected by GetFootprintRect():
|
||||||
|
for( auto item : m_drawings )
|
||||||
|
{
|
||||||
|
if( item->Type() != PCB_MODULE_EDGE_T )
|
||||||
|
area.Merge( item->GetBoundingBox() );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( m_Value->IsVisible() || aIncludeInvisibleText )
|
||||||
|
area.Merge( m_Value->GetBoundingBox() );
|
||||||
|
|
||||||
|
if( m_Reference->IsVisible() || aIncludeInvisibleText )
|
||||||
|
area.Merge( m_Reference->GetBoundingBox() );
|
||||||
|
|
||||||
|
return area;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a bit hacky right now for performance reasons.
|
* This is a bit hacky right now for performance reasons.
|
||||||
*
|
*
|
||||||
|
|
|
@ -160,6 +160,8 @@ public:
|
||||||
// Virtual function
|
// Virtual function
|
||||||
const EDA_RECT GetBoundingBox() const override;
|
const EDA_RECT GetBoundingBox() const override;
|
||||||
|
|
||||||
|
const EDA_RECT GetBoundingBox( bool aIncludeInvisibleText ) const;
|
||||||
|
|
||||||
PADS& Pads()
|
PADS& Pads()
|
||||||
{
|
{
|
||||||
return m_pads;
|
return m_pads;
|
||||||
|
|
Loading…
Reference in New Issue