Skip to content
Permalink
Browse files

Replace svg params also for preview

  • Loading branch information
mhugent committed Jun 29, 2011
1 parent 7e274d8 commit 0a15a072ea7790af2a1b6e6f067a9fba19e2338b
Showing with 6 additions and 9 deletions.
  1. +6 −9 src/gui/symbology-ng/qgssymbollayerv2widget.cpp
@@ -538,20 +538,17 @@ class QgsSvgListModel : public QAbstractListModel

if ( role == Qt::DecorationRole ) // icon
{

QPixmap pixmap;
if ( !QPixmapCache::find( entry, pixmap ) )
{
// render SVG file
QSvgRenderer renderer;
QPainter painter;
renderer.load( entry );
pixmap = QPixmap( QSize( 24, 24 ) );
pixmap.fill();
painter.begin( &pixmap );
renderer.render( &painter );
painter.end();
QColor fill, outline;
double outlineWidth;
bool fillParam, outlineParam, outlineWidthParam;
QgsSvgCache::instance()->containsParams( entry, fillParam, fill, outlineParam, outline, outlineWidthParam, outlineWidth );

const QImage& img = QgsSvgCache::instance()->svgAsImage( entry, 8, fill, outline, outlineWidth, 3.5 /*appr. 88 dpi*/, 1.0 );
pixmap = QPixmap::fromImage( img );
QPixmapCache::insert( entry, pixmap );
}

0 comments on commit 0a15a07

Please sign in to comment.
You can’t perform that action at this time.