Browse Source

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
pcb_db
Seth Hillbrand 10 months ago
parent
commit
4eb0e70ddf
  1. 6
      common/board_printout.cpp
  2. 6
      eeschema/printing/sch_printout.cpp

6
common/board_printout.cpp

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

6
eeschema/printing/sch_printout.cpp

@ -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…
Cancel
Save