diff --git a/common/bitmap_base.cpp b/common/bitmap_base.cpp index 6fb6b6e875..f470403d5a 100644 --- a/common/bitmap_base.cpp +++ b/common/bitmap_base.cpp @@ -261,10 +261,15 @@ void BITMAP_BASE::DrawBitmap( wxDC* aDC, const wxPoint& aPos ) aDC->SetUserScale( scale * GetScalingFactor(), scale * GetScalingFactor() ); aDC->SetLogicalOrigin( logicalOriginX / GetScalingFactor(), logicalOriginY / GetScalingFactor() ); - aDC->DrawBitmap( *m_bitmap, - KiROUND( pos.x / GetScalingFactor() ), - KiROUND( pos.y / GetScalingFactor() ), - true ); + + 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->SetClippingRegion( pos, size ); + aDC->DrawBitmap( *m_bitmap, pos.x, pos.y, true ); + aDC->DestroyClippingRegion(); aDC->SetUserScale( scale, scale ); aDC->SetLogicalOrigin( logicalOriginX, logicalOriginY ); }