Don't include annotations in boundingbox when not including text.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15411

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15411
This commit is contained in:
Jeff Young 2023-08-26 18:44:47 +01:00
parent 22256c97f3
commit bc3c8b19c6
2 changed files with 13 additions and 4 deletions

View File

@ -1008,9 +1008,18 @@ const BOX2I FOOTPRINT::GetBoundingBox( bool aIncludeText, bool aIncludeInvisible
continue;
}
// Treat dimension objects as text
if( !aIncludeText && BaseType( item->Type() ) == PCB_DIMENSION_T )
continue;
// If we're not including text then drop annotations as well
if( !aIncludeText )
{
if( BaseType( item->Type() ) == PCB_DIMENSION_T )
continue;
if( item->GetLayer() == Cmts_User || item->GetLayer() == Dwgs_User
|| item->GetLayer() == Eco1_User || item->GetLayer() == Eco2_User )
{
continue;
}
}
bbox.Merge( item->GetBoundingBox() );
}

View File

@ -699,7 +699,7 @@ const BOX2I FOOTPRINT_EDIT_FRAME::GetDocumentExtents( bool aIncludeAllVisible )
{
for( const BOARD_ITEM* item : footprint->GraphicalItems() )
{
if( item->Type() == PCB_TEXT_T )
if( item->Type() == PCB_TEXT_T || item->Type() == PCB_TEXTBOX_T )
continue;
hasGraphicalItem = true;