Skip to content

Commit

Permalink
Use transparent background color for symbol / symbol layer preview
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@14811 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Nov 30, 2010
1 parent 77d1fd0 commit b04b187
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgssymbollayerv2utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,10 @@ QPixmap QgsSymbolLayerV2Utils::symbolPreviewPixmap( QgsSymbolV2* symbol, QSize s
Q_ASSERT( symbol );

QPixmap pixmap( size );
pixmap.fill( Qt::transparent );
QPainter painter;
painter.begin( &pixmap );
painter.setRenderHint( QPainter::Antialiasing );
painter.eraseRect( QRect( QPoint( 0, 0 ), size ) );
symbol->drawPreviewIcon( &painter, size );
painter.end();
return pixmap;
Expand All @@ -239,10 +239,10 @@ QPixmap QgsSymbolLayerV2Utils::symbolPreviewPixmap( QgsSymbolV2* symbol, QSize s
QIcon QgsSymbolLayerV2Utils::symbolLayerPreviewIcon( QgsSymbolLayerV2* layer, QgsSymbolV2::OutputUnit u, QSize size )
{
QPixmap pixmap( size );
pixmap.fill( Qt::transparent );
QPainter painter;
painter.begin( &pixmap );
painter.setRenderHint( QPainter::Antialiasing );
painter.eraseRect( QRect( QPoint( 0, 0 ), size ) );
QgsRenderContext renderContext = createRenderContext( &painter );
QgsSymbolV2RenderContext symbolContext( renderContext, u );
layer->drawPreviewIcon( symbolContext, size );
Expand Down

0 comments on commit b04b187

Please sign in to comment.