mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-03-30 06:16:56 +00:00
Fix issue preventing printing on some platforms
Linux printing for some systems blanked the printouts when the gal screensize was set here. Restoring the screensize after clearing ensures that the view redraw is properly scaled Fixes https://gitlab.com/kicad/code/kicad/issues/19807
This commit is contained in:
parent
879e76b28e
commit
4eb0e70ddf
@ -175,8 +175,14 @@ void BOARD_PRINTOUT::DrawPage( const wxString& aLayerName, int aPageNum, int aPa
|
||||
gal->SetLookAtPoint( drawingAreaBBox.Centre() );
|
||||
gal->SetZoomFactor( m_settings.m_scale );
|
||||
gal->SetClearColor( dstSettings->GetBackgroundColor() );
|
||||
|
||||
// Clearing the screen for the background color needs the screen set to the page size
|
||||
// in pixels. This can ?somehow? prevent some but not all foreground elements from being printed
|
||||
// TODO: figure out what's going on here and fix printing. See also sch_printout
|
||||
VECTOR2I size = gal->GetScreenPixelSize();
|
||||
gal->ResizeScreen( pageSizePx.GetWidth(),pageSizePx.GetHeight() );
|
||||
gal->ClearScreen();
|
||||
gal->ResizeScreen( size.x, size.y );
|
||||
|
||||
if( m_gerbviewPrint )
|
||||
// Mandatory in Gerbview to use the same order for printing as for screen redraw
|
||||
|
@ -429,8 +429,14 @@ bool SCH_PRINTOUT::PrintPage( SCH_SCREEN* aScreen, wxDC* aDC, bool aForPrinting
|
||||
gal->SetLookAtPoint( drawingAreaBBox.Centre() );
|
||||
gal->SetZoomFactor( print_scale );
|
||||
gal->SetClearColor( dstSettings->GetBackgroundColor() );
|
||||
|
||||
// Clearing the screen for the background color needs the screen set to the page size
|
||||
// in pixels. This can ?somehow? prevent some but not all foreground elements from being printed
|
||||
// TODO: figure out what's going on here and fix printing. See also board_printout
|
||||
VECTOR2I size = gal->GetScreenPixelSize();
|
||||
gal->ResizeScreen( pageSizePix.GetWidth(),pageSizePix.GetHeight() );
|
||||
gal->ClearScreen();
|
||||
gal->ResizeScreen( size.x, size.y );
|
||||
|
||||
// Needed to use the same order for printing as for screen redraw
|
||||
view->UseDrawPriority( true );
|
||||
|
Loading…
Reference in New Issue
Block a user