Skip to content
Permalink
Browse files
Fix incorrect transparency for symbology previews in legend and vecto…
…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 1e68db917936e2a43f01d8bf44dfb729ac9f0a03
Showing with 10 additions and 4 deletions.
  1. +10 −4 src/core/symbology/qgssymbol.cpp
@@ -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 );
@@ -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 );
@@ -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 );
}

0 comments on commit 1e68db9

Please sign in to comment.