[Libreoffice-commits] .: vcl/source
Radek DoulÃk
rodo at kemper.freedesktop.org
Thu Sep 1 11:32:39 PDT 2011
vcl/source/gdi/outdev4.cxx | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
New commits:
commit 72051f5a6bd84274e9312e13a7643b01f14b459f
Author: Muthu Subramanian <SuMuthu at suse.com>
Date: Thu Sep 1 20:00:00 2011 +0200
fix for linear gradient export to PDF
Signed-off-by: Radek Doulik <rodo at novell.com>
diff --git a/vcl/source/gdi/outdev4.cxx b/vcl/source/gdi/outdev4.cxx
index f382876..0205f21 100644
--- a/vcl/source/gdi/outdev4.cxx
+++ b/vcl/source/gdi/outdev4.cxx
@@ -315,11 +315,19 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
// Startpolygon erzeugen (== Borderpolygon)
Polygon aPoly( 4 );
Polygon aTempPoly( 2 );
+ Polygon aTempPoly2( 2 );
+ /* n#710061 Use overlapping fills to avoid color
+ * leak via gaps in some pdf viewers
+ */
+ Point aOverLap( 0, fScanInc*5 );
aPoly[0] = aFullRect.TopLeft();
aPoly[1] = aFullRect.TopRight();
aPoly[2] = aRect.TopRight();
aPoly[3] = aRect.TopLeft();
aPoly.Rotate( aCenter, nAngle );
+ aTempPoly[0] = aPoly[3];
+ aTempPoly[1] = aPoly[2];
+
// Schleife, um rotierten Verlauf zu fuellen
for ( long i = 0; i < nSteps2; i++ )
@@ -333,23 +341,27 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
// neues Polygon berechnen
aRect.Top() = (long)(fScanLine += fScanInc);
+ aPoly[0] = aTempPoly[0];
+ aPoly[1] = aTempPoly[1];
// unteren Rand komplett fuellen
if ( i == nSteps )
{
aTempPoly[0] = aFullRect.BottomLeft();
aTempPoly[1] = aFullRect.BottomRight();
+ aTempPoly2 = aTempPoly;
}
else
{
aTempPoly[0] = aRect.TopLeft();
aTempPoly[1] = aRect.TopRight();
+ aTempPoly2[0]= aTempPoly[0] + aOverLap;
+ aTempPoly2[1]= aTempPoly[1] + aOverLap;
}
+ aTempPoly2.Rotate( aCenter, nAngle );
aTempPoly.Rotate( aCenter, nAngle );
- aPoly[0] = aPoly[3];
- aPoly[1] = aPoly[2];
- aPoly[2] = aTempPoly[1];
- aPoly[3] = aTempPoly[0];
+ aPoly[2] = aTempPoly2[1];
+ aPoly[3] = aTempPoly2[0];
// Farbintensitaeten aendern...
// fuer lineare FV
More information about the Libreoffice-commits
mailing list