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-11 15:59:14.593750000 +0800 @@ -2089,10 +2089,23 @@ case META_BMPSCALE_ACTION: { MetaBmpScaleAction* pAct = static_cast(pCurrAct); + BitmapEx aBitmap = pAct->GetBitmap(); + long nX = ( pAct->GetSize()).Width(); + long nY = ( pAct->GetSize()).Height(); + + if ( nX < 0 ) + { + aBitmap.Mirror( BMP_MIRROR_HORZ ); + } + else if( nY < 0 ) + { + aBitmap.Mirror( BMP_MIRROR_VERT ); + } ActionSharedPtr pBmpAction( internal::BitmapActionFactory::createBitmapAction( - pAct->GetBitmap(), + //pAct->GetBitmap(), + aBitmap, rVDev.LogicToPixel( pAct->GetPoint() ), rVDev.LogicToPixel( pAct->GetSize() ), rCanvas, @@ -2117,6 +2130,18 @@ // 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(); + + if ( nX < 0 ) + { + aBmp.Mirror( BMP_MIRROR_HORZ ); + } + else if( nY < 0 ) + { + aBmp.Mirror( BMP_MIRROR_VERT ); + } + const Rectangle aCropRect( pAct->GetSrcPoint(), pAct->GetSrcSize() ); aBmp.Crop( aCropRect ); @@ -2167,10 +2192,23 @@ case META_BMPEXSCALE_ACTION: { MetaBmpExScaleAction* pAct = static_cast(pCurrAct); + BitmapEx aBitmap = pAct->GetBitmapEx(); + long nX = ( pAct->GetSize()).Width(); + long nY = ( pAct->GetSize()).Height(); + + if ( nX < 0 ) + { + aBitmap.Mirror( BMP_MIRROR_HORZ ); + } + else if( nY < 0 ) + { + aBitmap.Mirror( BMP_MIRROR_VERT ); + } ActionSharedPtr pBmpAction( internal::BitmapActionFactory::createBitmapAction( - pAct->GetBitmapEx(), + //pAct->GetBitmapEx(), + aBitmap, rVDev.LogicToPixel( pAct->GetPoint() ), rVDev.LogicToPixel( pAct->GetSize() ), rCanvas, @@ -2195,6 +2233,18 @@ // 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(); + + if ( nX < 0 ) + { + aBmp.Mirror( BMP_MIRROR_HORZ ); + } + else if( nY < 0 ) + { + aBmp.Mirror( BMP_MIRROR_VERT ); + } + const Rectangle aCropRect( pAct->GetSrcPoint(), pAct->GetSrcSize() ); aBmp.Crop( aCropRect ); @@ -2258,6 +2308,18 @@ BitmapEx aBmp( createMaskBmpEx( pAct->GetBitmap(), pAct->GetColor() )); + long nX = ( pAct->GetSize()).Width(); + long nY = ( pAct->GetSize()).Height(); + + if ( nX < 0 ) + { + aBmp.Mirror( BMP_MIRROR_HORZ ); + } + else if( nY < 0 ) + { + aBmp.Mirror( BMP_MIRROR_VERT ); + } + ActionSharedPtr pBmpAction( internal::BitmapActionFactory::createBitmapAction( aBmp, @@ -2288,6 +2350,18 @@ BitmapEx aBmp( createMaskBmpEx( pAct->GetBitmap(), pAct->GetColor() )); + long nX = ( pAct->GetDestSize()).Width(); + long nY = ( pAct->GetDestSize()).Height(); + + if ( nX < 0 ) + { + aBmp.Mirror( BMP_MIRROR_HORZ ); + } + else if( nY < 0 ) + { + aBmp.Mirror( BMP_MIRROR_VERT ); + } + // crop bitmap to given source rectangle (no // need to copy and convert the whole bitmap) const Rectangle aCropRect( pAct->GetSrcPoint(),