Skip to content

Commit 0829486

Browse files
author
wonder
committedNov 30, 2010
Use transparent background color for symbol / symbol layer preview
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14811 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/core/symbology-ng/qgssymbollayerv2utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,10 @@ QPixmap QgsSymbolLayerV2Utils::symbolPreviewPixmap( QgsSymbolV2* symbol, QSize s
226226
Q_ASSERT( symbol );
227227

228228
QPixmap pixmap( size );
229+
pixmap.fill( Qt::transparent );
229230
QPainter painter;
230231
painter.begin( &pixmap );
231232
painter.setRenderHint( QPainter::Antialiasing );
232-
painter.eraseRect( QRect( QPoint( 0, 0 ), size ) );
233233
symbol->drawPreviewIcon( &painter, size );
234234
painter.end();
235235
return pixmap;
@@ -239,10 +239,10 @@ QPixmap QgsSymbolLayerV2Utils::symbolPreviewPixmap( QgsSymbolV2* symbol, QSize s
239239
QIcon QgsSymbolLayerV2Utils::symbolLayerPreviewIcon( QgsSymbolLayerV2* layer, QgsSymbolV2::OutputUnit u, QSize size )
240240
{
241241
QPixmap pixmap( size );
242+
pixmap.fill( Qt::transparent );
242243
QPainter painter;
243244
painter.begin( &pixmap );
244245
painter.setRenderHint( QPainter::Antialiasing );
245-
painter.eraseRect( QRect( QPoint( 0, 0 ), size ) );
246246
QgsRenderContext renderContext = createRenderContext( &painter );
247247
QgsSymbolV2RenderContext symbolContext( renderContext, u );
248248
layer->drawPreviewIcon( symbolContext, size );

0 commit comments

Comments
 (0)
Please sign in to comment.