@@ -138,7 +138,7 @@ const QImage& QgsSvgCache::svgAsImage( const QString& file, double size, const Q
138
138
// instead cache picture
139
139
if ( !currentEntry->picture )
140
140
{
141
- cachePicture ( currentEntry );
141
+ cachePicture ( currentEntry, false );
142
142
}
143
143
}
144
144
else
@@ -152,15 +152,15 @@ const QImage& QgsSvgCache::svgAsImage( const QString& file, double size, const Q
152
152
}
153
153
154
154
const QPicture& QgsSvgCache::svgAsPicture ( const QString& file, double size, const QColor& fill, const QColor& outline, double outlineWidth,
155
- double widthScaleFactor, double rasterScaleFactor )
155
+ double widthScaleFactor, double rasterScaleFactor, bool forceVectorOutput )
156
156
{
157
157
QgsSvgCacheEntry* currentEntry = cacheEntry ( file, size, fill, outline, outlineWidth, widthScaleFactor, rasterScaleFactor );
158
158
159
159
// if current entry picture is 0: cache picture for entry
160
160
// update stats for memory usage
161
161
if ( !currentEntry->picture )
162
162
{
163
- cachePicture ( currentEntry );
163
+ cachePicture ( currentEntry, forceVectorOutput );
164
164
trimToMaximumSize ();
165
165
}
166
166
@@ -398,7 +398,7 @@ void QgsSvgCache::cacheImage( QgsSvgCacheEntry* entry )
398
398
mTotalSize += ( image->width () * image->height () * 32 );
399
399
}
400
400
401
- void QgsSvgCache::cachePicture ( QgsSvgCacheEntry *entry )
401
+ void QgsSvgCache::cachePicture ( QgsSvgCacheEntry *entry, bool forceVectorOutput )
402
402
{
403
403
if ( !entry )
404
404
{
@@ -418,7 +418,7 @@ void QgsSvgCache::cachePicture( QgsSvgCacheEntry *entry )
418
418
hwRatio = r.viewBoxF ().height () / r.viewBoxF ().width ();
419
419
}
420
420
bool drawOnScreen = qgsDoubleNear ( entry->rasterScaleFactor , 1.0 , 0.1 );
421
- if ( drawOnScreen )
421
+ if ( drawOnScreen && forceVectorOutput ) // forceVectorOutput always true in case of composer draw / composer preview
422
422
{
423
423
// fix to ensure rotated symbols scale with composer page (i.e. not map item) zoom
424
424
double wSize = entry->size ;
0 commit comments