Don't use ViewBBox for zoom-to-fit.
The ViewBBox can include the largest document clearance so that pad clearance lines get included. But the largest clearance can be, well, large. Fixes https://gitlab.com/kicad/code/kicad/issues/14276
This commit is contained in:
parent
1058d36315
commit
725834b554
|
@ -1513,11 +1513,8 @@ const BOX2I FOOTPRINT::ViewBBox() const
|
|||
{
|
||||
BOX2I area = GetBoundingBox( true, true );
|
||||
|
||||
// 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).
|
||||
const BOARD* board = GetBoard();
|
||||
|
||||
if( board )
|
||||
// Inflate in case clearance lines are drawn around pads, etc.
|
||||
if( const BOARD* board = GetBoard() )
|
||||
{
|
||||
int biggest_clearance = board->GetDesignSettings().GetBiggestClearanceValue();
|
||||
area.Inflate( biggest_clearance );
|
||||
|
|
|
@ -129,9 +129,7 @@ void FOOTPRINT_PREVIEW_PANEL::renderFootprint( std::shared_ptr<FOOTPRINT> aFootp
|
|||
|
||||
void FOOTPRINT_PREVIEW_PANEL::fitToCurrentFootprint()
|
||||
{
|
||||
BOX2I bbox = m_currentFootprint->ViewBBox();
|
||||
bbox.Merge( m_currentFootprint->Value().ViewBBox() );
|
||||
bbox.Merge( m_currentFootprint->Reference().ViewBBox() );
|
||||
BOX2I bbox = m_currentFootprint->GetBoundingBox( true, false );
|
||||
|
||||
if( bbox.GetSize().x > 0 && bbox.GetSize().y > 0 )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue