Skip to content

Commit

Permalink
Fix incorrect transparency for symbology previews in legend and vecto…
Browse files Browse the repository at this point in the history
…r props dialog

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9482 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Oct 16, 2008
1 parent a069db9 commit 1e68db9
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/core/symbology/qgssymbol.cpp
Expand Up @@ -248,7 +248,8 @@ QImage QgsSymbol::getLineSymbolAsImage()
//Note by Tim: dont use premultiplied - it causes
//artifacts on the output icon!
QImage img( 15, 15, QImage::Format_ARGB32 );//QImage::Format_ARGB32_Premultiplied);
img.fill( QColor( 255, 255, 255, 255 ).rgba() );
//0 = fully transparent
img.fill( QColor( 255, 255, 255, 0 ).rgba() );
QPainter p( &img );
p.setRenderHints( QPainter::Antialiasing );
p.setPen( mPen );
Expand All @@ -267,7 +268,8 @@ QImage QgsSymbol::getPolygonSymbolAsImage()
//Note by Tim: dont use premultiplied - it causes
//artifacts on the output icon!
QImage img( 15, 15, QImage::Format_ARGB32 ); //, QImage::Format_ARGB32_Premultiplied);
img.fill( QColor( 255, 255, 255, 255 ).rgba() );
//0 = fully transparent
img.fill( QColor( 255, 255, 255, 0 ).rgba() );
QPainter p( &img );
p.setRenderHints( QPainter::Antialiasing );
p.setPen( mPen );
Expand Down Expand Up @@ -346,12 +348,16 @@ QImage QgsSymbol::getPointSymbolAsImage( double widthScale, bool selected, QColo
{
pen.setColor( selectionColor );
QBrush brush = mBrush;
preRotateImage = QgsMarkerCatalogue::instance()->imageMarker( mPointSymbolName, ( float )( mPointSize * scale * widthScale * rasterScaleFactor ),
preRotateImage = QgsMarkerCatalogue::instance()->imageMarker(
mPointSymbolName, ( float )( mPointSize * scale * widthScale *
rasterScaleFactor ),
pen, mBrush );
}
else
{
preRotateImage = QgsMarkerCatalogue::instance()->imageMarker( mPointSymbolName, ( float )( mPointSize * scale * widthScale * rasterScaleFactor ),
preRotateImage = QgsMarkerCatalogue::instance()->imageMarker(
mPointSymbolName, ( float )( mPointSize * scale * widthScale *
rasterScaleFactor ),
pen, mBrush );
}

Expand Down

0 comments on commit 1e68db9

Please sign in to comment.