CADSTAR Sch: Fix calculation of page size

Don't attempt to calculate bounding box of text variables. We do not
know the resolution of the text variable inside the importer. The
resolved text could be shorter than the text variable (e.g. ${#}
page number)
This commit is contained in:
Roberto Fernandez Bautista 2021-10-30 21:46:32 +01:00
parent 0aba025d66
commit 8367c7f238
1 changed files with 10 additions and 0 deletions

View File

@ -173,6 +173,16 @@ void CADSTAR_SCH_ARCHIVE_LOADER::Load( SCHEMATIC* aSchematic, SCH_SHEET* aRootSh
bbox.Merge( field.GetBoundingBox() );
}
}
else if( item->Type() == SCH_TEXT_T )
{
SCH_TEXT* txtItem = static_cast<SCH_TEXT*>( item );
wxString txt = txtItem->GetText();
if( txt.Contains( "${" ) )
continue; // We can't calculate bounding box of text items with variables
else
bbox = txtItem->GetBoundingBox();
}
else
{
bbox = item->GetBoundingBox();