[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-text-background-color' - vcl/source
matteocam
matteo.campanelli at gmail.com
Tue May 27 08:39:16 PDT 2014
vcl/source/outdev/text.cxx | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
New commits:
commit 6ec2a1a6922d22fa5efb25982b0b51cef7a97499
Author: matteocam <matteo.campanelli at gmail.com>
Date: Tue May 27 11:35:40 2014 -0400
Transparency by replacing DrawRect
Change-Id: I5ba220df841cbe650c910c1c7bc1815900f13c53
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 70d53b3..ef7f7e6 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -149,7 +149,12 @@ void OutputDevice::ImplDrawTextRect( long nBaseX, long nBaseY,
nX += nBaseX;
nY += nBaseY;
- mpGraphics->DrawRect( nX, nY, nWidth, nHeight, this );
+ //mpGraphics->DrawRect( nX, nY, nWidth, nHeight, this ); // original code
+ Rectangle aRect( Point( nX, nY ), Size( nWidth+1, nHeight+1 ) );
+ Polygon aPoly( aRect );
+ PolyPolygon aPolyPoly(aPoly);
+ DrawTransparent(aPolyPoly, 50);
+
}
void OutputDevice::ImplDrawTextBackground( const SalLayout& rSalLayout )
@@ -474,12 +479,12 @@ void OutputDevice::ImplDrawText( SalLayout& rSalLayout )
rSalLayout.DrawBase() += Point( mnTextOffX, mnTextOffY );
/*
- if the text has some background get it (XXX: now getting fixed color)
+ if the text has some background get it
and the set it as the new filling color
*/
if (mbTextBackground) {
- // set right background
- Color aColor = COL_BLUE;
+ // set right background // (XXX: now getting fixed color)
+ Color aColor = RGB_COLORDATA(0x66,0x66, 0xFF); // blue-ish
// SetBackground does not work
SetTextFillColor(aColor);
}
More information about the Libreoffice-commits
mailing list