diff -uNr old/cppcanvas/source/mtfrenderer/implrenderer.cxx new/cppcanvas/source/mtfrenderer/implrenderer.cxx --- old/cppcanvas/source/mtfrenderer/implrenderer.cxx 2007-07-10 16:32:12.000000000 +0800 +++ new/cppcanvas/source/mtfrenderer/implrenderer.cxx 2007-07-12 16:37:43.656250000 +0800 @@ -411,6 +411,30 @@ return BitmapEx( aSolid, aMask ); } + + void mirrorBmp(Bitmap& aBitmap,long nX,long nY) + { + if ( nX < 0 ) + { + aBitmap.Mirror( BMP_MIRROR_HORZ ); + } + if ( nY < 0 ) + { + aBitmap.Mirror( BMP_MIRROR_VERT ); + } + } + + void mirrorBmp(BitmapEx& aBitmap,long nX,long nY) + { + if ( nX < 0 ) + { + aBitmap.Mirror( BMP_MIRROR_HORZ ); + } + if ( nY < 0 ) + { + aBitmap.Mirror( BMP_MIRROR_VERT ); + } + } } @@ -2089,10 +2113,16 @@ case META_BMPSCALE_ACTION: { MetaBmpScaleAction* pAct = static_cast(pCurrAct); + Bitmap aBmp = pAct->GetBitmap(); + long nX = ( pAct->GetSize()).Width(); + long nY = ( pAct->GetSize()).Height(); + + mirrorBmp( aBmp,nX,nY ); ActionSharedPtr pBmpAction( internal::BitmapActionFactory::createBitmapAction( - pAct->GetBitmap(), + //pAct->GetBitmap(), + aBmp, rVDev.LogicToPixel( pAct->GetPoint() ), rVDev.LogicToPixel( pAct->GetSize() ), rCanvas, @@ -2117,6 +2147,11 @@ // crop bitmap to given source rectangle (no // need to copy and convert the whole bitmap) Bitmap aBmp( pAct->GetBitmap() ); + long nX = ( pAct->GetDestSize()).Width(); + long nY = ( pAct->GetDestSize()).Height(); + + mirrorBmp( aBmp,nX,nY ); + const Rectangle aCropRect( pAct->GetSrcPoint(), pAct->GetSrcSize() ); aBmp.Crop( aCropRect ); @@ -2167,10 +2202,16 @@ case META_BMPEXSCALE_ACTION: { MetaBmpExScaleAction* pAct = static_cast(pCurrAct); + BitmapEx aBmp = pAct->GetBitmapEx(); + long nX = ( pAct->GetSize()).Width(); + long nY = ( pAct->GetSize()).Height(); + + mirrorBmp( aBmp,nX,nY ); ActionSharedPtr pBmpAction( internal::BitmapActionFactory::createBitmapAction( - pAct->GetBitmapEx(), + //pAct->GetBitmapEx(), + aBmp, rVDev.LogicToPixel( pAct->GetPoint() ), rVDev.LogicToPixel( pAct->GetSize() ), rCanvas, @@ -2195,6 +2236,11 @@ // crop bitmap to given source rectangle (no // need to copy and convert the whole bitmap) BitmapEx aBmp( pAct->GetBitmapEx() ); + long nX = ( pAct->GetDestSize()).Width(); + long nY = ( pAct->GetDestSize()).Height(); + + mirrorBmp( aBmp,nX,nY ); + const Rectangle aCropRect( pAct->GetSrcPoint(), pAct->GetSrcSize() ); aBmp.Crop( aCropRect ); @@ -2258,6 +2304,11 @@ BitmapEx aBmp( createMaskBmpEx( pAct->GetBitmap(), pAct->GetColor() )); + long nX = ( pAct->GetSize()).Width(); + long nY = ( pAct->GetSize()).Height(); + + mirrorBmp( aBmp,nX,nY ); + ActionSharedPtr pBmpAction( internal::BitmapActionFactory::createBitmapAction( aBmp, @@ -2288,6 +2339,11 @@ BitmapEx aBmp( createMaskBmpEx( pAct->GetBitmap(), pAct->GetColor() )); + long nX = ( pAct->GetDestSize()).Width(); + long nY = ( pAct->GetDestSize()).Height(); + + mirrorBmp( aBmp,nX,nY ); + // crop bitmap to given source rectangle (no // need to copy and convert the whole bitmap) const Rectangle aCropRect( pAct->GetSrcPoint(),