diff options
author | Thorsten Behrens <tbehrens@suse.com> | 2012-03-06 23:07:00 +0100 |
---|---|---|
committer | Thorsten Behrens <tbehrens@suse.com> | 2012-03-16 17:02:21 +0100 |
commit | 50309b9574c43de93a05576904813881eb7bc898 (patch) | |
tree | 6a1bbf46d336e1536d25151c1ab4da02acf163e4 | |
parent | 83114b27fac8ef723cbbaa734237210d9ad56a15 (diff) |
Another partial fix for fdo#45219
Make sure transparent polygons really only cover the polygonal area,
not the whole bounding box for sprites.
-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 ); } } } |