diff options
author | Muthu Subramanian <SuMuthu@suse.com> | 2011-09-01 20:00:00 +0200 |
---|---|---|
committer | Radek Doulik <rodo@novell.com> | 2011-09-01 20:32:29 +0200 |
commit | 72051f5a6bd84274e9312e13a7643b01f14b459f (patch) | |
tree | 80559e71105dabf5778d651171f097c3d644798a /vcl | |
parent | e90b1a0c7ba0e7c7d42bed919de584c5c79aa5ea (diff) |
fix for linear gradient export to PDF
Signed-off-by: Radek Doulik <rodo@novell.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/outdev4.cxx | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/vcl/source/gdi/outdev4.cxx b/vcl/source/gdi/outdev4.cxx index f3828761bd6f..0205f21d13ef 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 |