summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Lohmann [pl] <Philipp.Lohmann@Sun.COM>2010-10-06 11:30:10 +0200
committerPhilipp Lohmann [pl] <Philipp.Lohmann@Sun.COM>2010-10-06 11:30:10 +0200
commit967df99b1d91bbc884dfada36df16eead61f2d95 (patch)
tree5af071bfedb88e731109fb9e83a0138566d3abd3
parentc4dc91f5f2a7e04926070bbaabcd58ce85bb516d (diff)
ooo33gsl10: #i97556# fix ImplDrawAlpha in RTL case
-rwxr-xr-x[-rw-r--r--]vcl/source/gdi/outdev2.cxx11
-rwxr-xr-x[-rw-r--r--]vcl/source/window/window.cxx0
2 files changed, 9 insertions, 2 deletions
diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index bea307a4c38d..06dcd73cc3d4 100644..100755
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -1988,7 +1988,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;
@@ -2002,7 +2010,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 ];
}
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index adedbde4c0f2..adedbde4c0f2 100644..100755
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx