From 0593f3b0c3440c195177b5f6873d97c390fdf8ae Mon Sep 17 00:00:00 2001 From: Jonathan Haas Date: Mon, 12 Apr 2021 15:38:10 +0200 Subject: [PATCH] Fill gc with background color before copying to clipboard Fixes https://gitlab.com/kicad/code/kicad/issues/7995 --- eeschema/sch_edit_frame.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 27e9959302..841bbcee50 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -1070,6 +1070,11 @@ void SCH_EDIT_FRAME::PrintPage( const RENDER_SETTINGS* aSettings ) { wxString fileName = Prj().AbsolutePath( GetScreen()->GetFileName() ); + const wxBrush& brush = + wxBrush( GetColorSettings()->GetColor( LAYER_SCHEMATIC_BACKGROUND ).ToColour() ); + aSettings->GetPrintDC()->SetBackground( brush ); + aSettings->GetPrintDC()->Clear(); + aSettings->GetPrintDC()->SetLogicalFunction( wxCOPY ); GetScreen()->Print( aSettings ); PrintDrawingSheet( aSettings, GetScreen(), IU_PER_MILS, fileName );