From 8367c7f23893904b58fb89b0b6cffb7fdc7005f9 Mon Sep 17 00:00:00 2001 From: Roberto Fernandez Bautista Date: Sat, 30 Oct 2021 21:46:32 +0100 Subject: [PATCH] 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) --- .../sch_plugins/cadstar/cadstar_sch_archive_loader.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp index 7b49c5bff9..d6650cc7ae 100644 --- a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp +++ b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp @@ -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( 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();