From 5960f0ae40ed8cb9c5ee94474cea326e9b4de832 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 17 Sep 2002 12:45:03 +0000 Subject: #103209# Handling negative sizes --- vcl/source/gdi/print2.cxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx index 1c040e7d6bbb..ac5c8c6968e9 100644 --- a/vcl/source/gdi/print2.cxx +++ b/vcl/source/gdi/print2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: print2.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: hdu $ $Date: 2002-02-26 15:57:28 $ + * last change: $Author: thb $ $Date: 2002-09-17 13:45:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -722,7 +722,11 @@ Bitmap Printer::GetPreparedBitmap( const Point& rDstPt, const Size& rDstSz, if( !aBmp.IsEmpty() ) { // do downsampling if neccessary - const Size aDstSizeTwip( PixelToLogic( LogicToPixel( rDstSz ), MAP_TWIP ) ); + Size aDstSizeTwip( PixelToLogic( LogicToPixel( rDstSz ), MAP_TWIP ) ); + + // #103209# Normalize size (mirroring has to happen outside of this method) + aDstSizeTwip = Size( labs(aDstSizeTwip.Width()), labs(aDstSizeTwip.Height()) ); + const Size aBmpSize( aBmp.GetSizePixel() ); const double fBmpPixelX = aBmpSize.Width(); const double fBmpPixelY = aBmpSize.Height(); @@ -787,7 +791,11 @@ BitmapEx Printer::GetPreparedBitmapEx( const Point& rDstPt, const Size& rDstSz, if( !aBmpEx.IsEmpty() ) { // do downsampling if neccessary - const Size aDstSizeTwip( PixelToLogic( LogicToPixel( rDstSz ), MAP_TWIP ) ); + Size aDstSizeTwip( PixelToLogic( LogicToPixel( rDstSz ), MAP_TWIP ) ); + + // #103209# Normalize size (mirroring has to happen outside of this method) + aDstSizeTwip = Size( labs(aDstSizeTwip.Width()), labs(aDstSizeTwip.Height()) ); + const Size aBmpSize( aBmpEx.GetSizePixel() ); const double fBmpPixelX = aBmpSize.Width(); const double fBmpPixelY = aBmpSize.Height(); -- cgit