Fix bitmap scaling when reading legacy schematic as well.

(cherry picked from commit bfc3e2d29b)
This commit is contained in:
Alex 2023-03-04 00:11:09 +03:00 committed by dsa-t
parent e51d43568e
commit e3cf65fbdf
1 changed files with 7 additions and 1 deletions

View File

@ -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;
}