From 4ebb87d1c1915ae31113ffa4efe4c7d7d33f42a5 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sat, 11 Jan 2020 09:55:30 -0800 Subject: [PATCH] Fix Eeschema BW printing Checks forced state when printing to convert images to grayscale. --- common/bitmap_base.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/common/bitmap_base.cpp b/common/bitmap_base.cpp index f470403d5a..79c6327a64 100644 --- a/common/bitmap_base.cpp +++ b/common/bitmap_base.cpp @@ -266,9 +266,18 @@ void BITMAP_BASE::DrawBitmap( wxDC* aDC, const wxPoint& aPos ) pos.y = KiROUND( pos.y / GetScalingFactor() ); size.x = KiROUND( size.x / GetScalingFactor() ); size.y = KiROUND( size.y / GetScalingFactor() ); - aDC->SetClippingRegion( pos, size ); - aDC->DrawBitmap( *m_bitmap, pos.x, pos.y, true ); + + if( GetGRForceBlackPenState() ) + { + wxBitmap result( m_bitmap->ConvertToImage().ConvertToGreyscale() ); + aDC->DrawBitmap( result, pos.x, pos.y, true ); + } + else + { + aDC->DrawBitmap( *m_bitmap, pos.x, pos.y, true ); + } + aDC->DestroyClippingRegion(); aDC->SetUserScale( scale, scale ); aDC->SetLogicalOrigin( logicalOriginX, logicalOriginY );