diff options
author | Armin Le Grand <Armin.Le.Grand@Sun.COM> | 2010-07-14 18:50:58 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@Sun.COM> | 2010-07-14 18:50:58 +0200 |
commit | 73d5f4f09c66ea29710a382dbd5bf971f603d335 (patch) | |
tree | f0ef1a41724586dcdd93cbfd1b153fefc5744c17 /vcl/source/gdi/outdev6.cxx | |
parent | 78d231a2b56c7a1d3bce10ae3bbd5b915fddff1b (diff) |
#i112959# enhanced bad handling of DrawTransparent in printer case
Diffstat (limited to 'vcl/source/gdi/outdev6.cxx')
-rw-r--r-- | vcl/source/gdi/outdev6.cxx | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx index 47b150ddc4c5..ebb91c82367d 100644 --- a/vcl/source/gdi/outdev6.cxx +++ b/vcl/source/gdi/outdev6.cxx @@ -345,6 +345,13 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly, if( OUTDEV_PRINTER == meOutDevType ) { + if(100 >= nTransparencePercent) + { + // #i112959# 100% transparent, draw nothing + return; + } + + Rectangle aPolyRect( LogicToPixel( rPolyPoly ).GetBoundRect() ); const Size aDPISize( LogicToPixel( Size( 1, 1 ), MAP_INCH ) ); const long nBaseExtent = Max( FRound( aDPISize.Width() / 300. ), 1L ); @@ -359,30 +366,40 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly, case( 25 ): nMove = nBaseExtent * 3; break; case( 50 ): nMove = nBaseExtent * 4; break; case( 75 ): nMove = nBaseExtent * 6; break; - // TODO What is the correct VALUE??? + + // #i112959# very transparent (88 < nTransparencePercent <= 99) + case( 100 ): nMove = nBaseExtent * 8; break; + + // #i112959# not transparent (nTransparencePercent < 13) default: nMove = 0; break; } Push( PUSH_CLIPREGION | PUSH_LINECOLOR ); IntersectClipRegion( rPolyPoly ); SetLineColor( GetFillColor() ); - - Rectangle aRect( aPolyRect.TopLeft(), Size( aPolyRect.GetWidth(), nBaseExtent ) ); - const BOOL bOldMap = mbMap; EnableMapMode( FALSE ); - while( aRect.Top() <= aPolyRect.Bottom() ) + if(nMove) { - DrawRect( aRect ); - aRect.Move( 0, nMove ); - } + Rectangle aRect( aPolyRect.TopLeft(), Size( aPolyRect.GetWidth(), nBaseExtent ) ); + while( aRect.Top() <= aPolyRect.Bottom() ) + { + DrawRect( aRect ); + aRect.Move( 0, nMove ); + } - aRect = Rectangle( aPolyRect.TopLeft(), Size( nBaseExtent, aPolyRect.GetHeight() ) ); - while( aRect.Left() <= aPolyRect.Right() ) + aRect = Rectangle( aPolyRect.TopLeft(), Size( nBaseExtent, aPolyRect.GetHeight() ) ); + while( aRect.Left() <= aPolyRect.Right() ) + { + DrawRect( aRect ); + aRect.Move( nMove, 0 ); + } + } + else { - DrawRect( aRect ); - aRect.Move( nMove, 0 ); + // #i112959# if not transparent, draw full rectangle in clip region + DrawRect( aPolyRect ); } EnableMapMode( bOldMap ); |