Don't zoom all the way in on a new footprint.
Fixes https://gitlab.com/kicad/code/kicad/issues/2220
This commit is contained in:
parent
0d654b3574
commit
dea05336fc
|
@ -468,9 +468,34 @@ const BOX2I FOOTPRINT_EDIT_FRAME::GetDocumentExtents() const
|
|||
MODULE* module = GetBoard()->GetFirstModule();
|
||||
|
||||
if( module )
|
||||
return module->GetFootprintRect();
|
||||
else
|
||||
return GetBoardBoundingBox( false );
|
||||
{
|
||||
bool hasGraphicalItem = module->Pads().size() || module->Zones().size();
|
||||
|
||||
if( !hasGraphicalItem )
|
||||
{
|
||||
for( const BOARD_ITEM* item : module->GraphicalItems() )
|
||||
{
|
||||
if( item->Type() == PCB_MODULE_TEXT_T )
|
||||
continue;
|
||||
|
||||
hasGraphicalItem = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( hasGraphicalItem )
|
||||
{
|
||||
return module->GetFootprintRect();
|
||||
}
|
||||
else
|
||||
{
|
||||
BOX2I newModuleBB( { 0, 0 }, { 0, 0 } );
|
||||
newModuleBB.Inflate( Millimeter2iu( 12 ) );
|
||||
return newModuleBB;
|
||||
}
|
||||
}
|
||||
|
||||
return GetBoardBoundingBox( false );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue