From e3cf65fbdf5b92632400c6fe167559a4a92a5bb8 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 4 Mar 2023 00:11:09 +0300 Subject: [PATCH] Fix bitmap scaling when reading legacy schematic as well. (cherry picked from commit bfc3e2d29b22c128581e785eecd23aa31d4f2838) --- eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp b/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp index 6fafe624ce..5e36594c56 100644 --- a/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp +++ b/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp @@ -691,7 +691,13 @@ SCH_BITMAP* SCH_LEGACY_PLUGIN::loadBitmap( LINE_READER& aReader ) wxImage* image = new wxImage(); wxMemoryInputStream istream( stream ); image->LoadFile( istream, wxBITMAP_TYPE_PNG ); - bitmap->GetImage()->SetImage( image ); + + bitmap->SetImage( image ); + + // Legacy file formats assumed 300 image PPI at load. + BITMAP_BASE* bitmapImage = bitmap->GetImage(); + bitmapImage->SetScale( bitmapImage->GetScale() * bitmapImage->GetPPI() + / 300.0 ); break; }