Skip to content

Commit d1f02b7

Browse files
author
timlinux
committedOct 16, 2008
Fix incorrect transparency for symbology previews in legend and vector props dialog
git-svn-id: http://svn.osgeo.org/qgis/trunk@9482 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 0d4c63b commit d1f02b7

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed
 

‎src/core/symbology/qgssymbol.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ QImage QgsSymbol::getLineSymbolAsImage()
248248
//Note by Tim: dont use premultiplied - it causes
249249
//artifacts on the output icon!
250250
QImage img( 15, 15, QImage::Format_ARGB32 );//QImage::Format_ARGB32_Premultiplied);
251-
img.fill( QColor( 255, 255, 255, 255 ).rgba() );
251+
//0 = fully transparent
252+
img.fill( QColor( 255, 255, 255, 0 ).rgba() );
252253
QPainter p( &img );
253254
p.setRenderHints( QPainter::Antialiasing );
254255
p.setPen( mPen );
@@ -267,7 +268,8 @@ QImage QgsSymbol::getPolygonSymbolAsImage()
267268
//Note by Tim: dont use premultiplied - it causes
268269
//artifacts on the output icon!
269270
QImage img( 15, 15, QImage::Format_ARGB32 ); //, QImage::Format_ARGB32_Premultiplied);
270-
img.fill( QColor( 255, 255, 255, 255 ).rgba() );
271+
//0 = fully transparent
272+
img.fill( QColor( 255, 255, 255, 0 ).rgba() );
271273
QPainter p( &img );
272274
p.setRenderHints( QPainter::Antialiasing );
273275
p.setPen( mPen );
@@ -346,12 +348,16 @@ QImage QgsSymbol::getPointSymbolAsImage( double widthScale, bool selected, QColo
346348
{
347349
pen.setColor( selectionColor );
348350
QBrush brush = mBrush;
349-
preRotateImage = QgsMarkerCatalogue::instance()->imageMarker( mPointSymbolName, ( float )( mPointSize * scale * widthScale * rasterScaleFactor ),
351+
preRotateImage = QgsMarkerCatalogue::instance()->imageMarker(
352+
mPointSymbolName, ( float )( mPointSize * scale * widthScale *
353+
rasterScaleFactor ),
350354
pen, mBrush );
351355
}
352356
else
353357
{
354-
preRotateImage = QgsMarkerCatalogue::instance()->imageMarker( mPointSymbolName, ( float )( mPointSize * scale * widthScale * rasterScaleFactor ),
358+
preRotateImage = QgsMarkerCatalogue::instance()->imageMarker(
359+
mPointSymbolName, ( float )( mPointSize * scale * widthScale *
360+
rasterScaleFactor ),
355361
pen, mBrush );
356362
}
357363

0 commit comments

Comments
 (0)
Please sign in to comment.