Skip to content

Commit 895792a

Browse files
committed
Draw svg symbols as vectors if there is rotation
1 parent 1dfc3b7 commit 895792a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/core/symbology-ng/qgsmarkersymbollayerv2.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,10 +561,12 @@ void QgsSvgMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Re
561561
return;
562562
}
563563

564-
if ( mAngle != 0 )
564+
bool rotated = !doubleNear( mAngle, 0 );
565+
bool drawOnScreen = doubleNear( context.renderContext().rasterScaleFactor(), 1.0, 0.1 );
566+
if ( rotated )
565567
p->rotate( mAngle );
566568

567-
if ( doubleNear( context.renderContext().rasterScaleFactor(), 1.0, 0.1 ) )
569+
if ( drawOnScreen && !rotated )
568570
{
569571
const QImage& img = QgsSvgCache::instance()->svgAsImage( mPath, size, mFillColor, mOutlineColor, mOutlineWidth,
570572
context.renderContext().scaleFactor(), context.renderContext().rasterScaleFactor() );

src/core/symbology-ng/qgssvgcache.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ void QgsSvgCache::cachePicture( QgsSvgCacheEntry *entry )
240240

241241
//correct QPictures dpi correction
242242
QPicture* picture = new QPicture();
243-
double pictureSize = entry->size / 25.4 / entry->rasterScaleFactor * picture->logicalDpiX();
243+
double pictureSize = entry->size / 25.4 / ( entry->rasterScaleFactor * entry->widthScaleFactor ) * picture->logicalDpiX();
244244
QRectF rect( QPointF( -pictureSize / 2.0, -pictureSize / 2.0 ), QSizeF( pictureSize, pictureSize ) );
245245

246246

0 commit comments

Comments
 (0)