diff options
author | Noel Power <noel.power@novell.com> | 2010-10-13 15:17:38 +0100 |
---|---|---|
committer | Noel Power <noel.power@novell.com> | 2010-10-13 15:17:38 +0100 |
commit | 1f4a6a21cb5445d3ed0c7d544906d5c98e31447a (patch) | |
tree | 7d8ab04dc4750c8dec9e9194d496b89a46670ddc /vcl/source/gdi/outdev2.cxx | |
parent | 44b6cad4026d7c48325a43c970d05493c4113e1b (diff) | |
parent | 8e3b6ac3249200da87d1bd4b7ef0c7e51b706dd6 (diff) |
Merge branch 'master' of ssh://noelp@git.freedesktop.org/git/libreoffice/libs-gui
Diffstat (limited to 'vcl/source/gdi/outdev2.cxx')
-rwxr-xr-x[-rw-r--r--] | vcl/source/gdi/outdev2.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx index 29c22e8f7962..7aaa9d7d510a 100644..100755 --- a/vcl/source/gdi/outdev2.cxx +++ b/vcl/source/gdi/outdev2.cxx @@ -1986,7 +1986,15 @@ void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha, const long nSrcWidth = aBmpRect.GetWidth(), nSrcHeight = aBmpRect.GetHeight(); const long nDstWidth = aDstRect.GetWidth(), nDstHeight = aDstRect.GetHeight(); const long nOutWidth = aOutSz.Width(), nOutHeight = aOutSz.Height(); - const long nOffX = aDstRect.Left() - aOutPt.X(), nOffY = aDstRect.Top() - aOutPt.Y(); + // calculate offset in original bitmap + // in RTL case this is a little more complicated since the contents of the + // bitmap is not mirrored (it never is), however the paint region and bmp region + // are in mirrored coordinates, so the intersection of (aOutPt,aOutSz) with these + // is content wise somewhere else and needs to take mirroring into account + const long nOffX = IsRTLEnabled() + ? aOutSz.Width() - aDstRect.GetWidth() - (aDstRect.Left() - aOutPt.X()) + : aDstRect.Left() - aOutPt.X(), + nOffY = aDstRect.Top() - aOutPt.Y(); long nX, nOutX, nY, nOutY; long nMirrOffX = 0; long nMirrOffY = 0; @@ -2000,7 +2008,6 @@ void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha, for( nX = 0L, nOutX = nOffX; nX < nDstWidth; nX++, nOutX++ ) { pMapX[ nX ] = aBmpRect.Left() + nOutX * nSrcWidth / nOutWidth; - if( bHMirr ) pMapX[ nX ] = nMirrOffX - pMapX[ nX ]; } |