diff options
author | Thorsten Behrens <tbehrens@suse.com> | 2012-03-06 23:07:00 +0100 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2012-03-19 08:22:24 +0200 |
commit | bed182f5f3059e30c3e53a163a031de1f0c2bc46 (patch) | |
tree | 45f4c6c5da486bfca9002c9fc9b4ce35a08530a1 | |
parent | a1a4b8cdd14843457e520fa9494892e9704557d4 (diff) |
Another partial fix for fdo#45219
Make sure transparent polygons really only cover the polygonal area,
not the whole bounding box for sprites.
(cherry picked from commit 50309b9574c43de93a05576904813881eb7bc898)
Signed-off-by: Tor Lillqvist <tlillqvist@suse.com>
-rw-r--r-- | canvas/source/vcl/canvashelper.cxx | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx index 055edff70189..c5c5943683c7 100644 --- a/canvas/source/vcl/canvashelper.cxx +++ b/canvas/source/vcl/canvashelper.cxx @@ -500,27 +500,21 @@ namespace vclcanvas if( mp2ndOutDev ) { - if( !nTransparency || bSourceAlpha ) + // HACK. Normally, CanvasHelper does not care + // about actually what mp2ndOutDev is... + // well, here we do & assume a 1bpp target. + if( nTransparency > 127 ) { - // HACK. Normally, CanvasHelper does not care - // about actually what mp2ndOutDev is... - if( bSourceAlpha && nTransparency == 255 ) - { - mp2ndOutDev->getOutDev().SetDrawMode( DRAWMODE_WHITELINE | DRAWMODE_WHITEFILL | DRAWMODE_WHITETEXT | - DRAWMODE_WHITEGRADIENT | DRAWMODE_WHITEBITMAP ); - mp2ndOutDev->getOutDev().SetFillColor( COL_WHITE ); - mp2ndOutDev->getOutDev().DrawPolyPolygon( aPolyPoly ); - mp2ndOutDev->getOutDev().SetDrawMode( DRAWMODE_BLACKLINE | DRAWMODE_BLACKFILL | DRAWMODE_BLACKTEXT | - DRAWMODE_BLACKGRADIENT | DRAWMODE_BLACKBITMAP ); - } - else - { - mp2ndOutDev->getOutDev().DrawPolyPolygon( aPolyPoly ); - } + mp2ndOutDev->getOutDev().SetDrawMode( DRAWMODE_WHITELINE | DRAWMODE_WHITEFILL | DRAWMODE_WHITETEXT | + DRAWMODE_WHITEGRADIENT | DRAWMODE_WHITEBITMAP ); + mp2ndOutDev->getOutDev().SetFillColor( COL_WHITE ); + mp2ndOutDev->getOutDev().DrawPolyPolygon( aPolyPoly ); + mp2ndOutDev->getOutDev().SetDrawMode( DRAWMODE_BLACKLINE | DRAWMODE_BLACKFILL | DRAWMODE_BLACKTEXT | + DRAWMODE_BLACKGRADIENT | DRAWMODE_BLACKBITMAP ); } else { - mp2ndOutDev->getOutDev().DrawTransparent( aPolyPoly, (sal_uInt16)nTransPercent ); + mp2ndOutDev->getOutDev().DrawPolyPolygon( aPolyPoly ); } } } |