mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Printing multiple bitmaps
A long-standing issue with multiple workarounds (https://gitlab.com/kicad/code/kicad/-/issues/1877) prevented eeschema printouts with multiple images or images in both the worksheet and the schematic. We worked around this by ordering the bitmap printing to be the first step in the printing process. This partially worked but didn't get everything correct. The primary difficulty in debugging this was that the wxPrintPreview that we generate looked correct. Only the actual printout was incorrect. The fix is to explicitly clip bitmap drawing to the bitmap area, regardless of how large the bitmap is. (cherry picked from commit 69469b254a9039e81c43b482731bd721995dc9da)
This commit is contained in:
parent
4a16c603e9
commit
c72593ca01
@ -269,8 +269,13 @@ void BITMAP_BASE::DrawBitmap( wxDC* aDC, const VECTOR2I& aPos )
|
||||
|
||||
pos.x = KiROUND( pos.x / GetScalingFactor() );
|
||||
pos.y = KiROUND( pos.y / GetScalingFactor() );
|
||||
size.x = KiROUND( size.x / GetScalingFactor() );
|
||||
size.y = KiROUND( size.y / GetScalingFactor() );
|
||||
}
|
||||
|
||||
aDC->DestroyClippingRegion();
|
||||
aDC->SetClippingRegion( pos, size );
|
||||
|
||||
if( GetGRForceBlackPenState() )
|
||||
{
|
||||
wxBitmap result( m_bitmap->ConvertToImage().ConvertToGreyscale() );
|
||||
@ -288,6 +293,8 @@ void BITMAP_BASE::DrawBitmap( wxDC* aDC, const VECTOR2I& aPos )
|
||||
aDC->SetUserScale( scale, scale );
|
||||
aDC->SetLogicalOrigin( logicalOriginX, logicalOriginY );
|
||||
}
|
||||
|
||||
aDC->DestroyClippingRegion();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user