From 50309b9574c43de93a05576904813881eb7bc898 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 6 Mar 2012 23:07:00 +0100 Subject: Another partial fix for fdo#45219 Make sure transparent polygons really only cover the polygonal area, not the whole bounding box for sprites. --- canvas/source/vcl/canvashelper.cxx | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'canvas') 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 ); } } } -- cgit