Skip to content

Commit

Permalink
Draw svg symbols as vectors if there is rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Feb 14, 2012
1 parent 1dfc3b7 commit 895792a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
Expand Up @@ -561,10 +561,12 @@ void QgsSvgMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Re
return;
}

if ( mAngle != 0 )
bool rotated = !doubleNear( mAngle, 0 );
bool drawOnScreen = doubleNear( context.renderContext().rasterScaleFactor(), 1.0, 0.1 );
if ( rotated )
p->rotate( mAngle );

if ( doubleNear( context.renderContext().rasterScaleFactor(), 1.0, 0.1 ) )
if ( drawOnScreen && !rotated )
{
const QImage& img = QgsSvgCache::instance()->svgAsImage( mPath, size, mFillColor, mOutlineColor, mOutlineWidth,
context.renderContext().scaleFactor(), context.renderContext().rasterScaleFactor() );
Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgssvgcache.cpp
Expand Up @@ -240,7 +240,7 @@ void QgsSvgCache::cachePicture( QgsSvgCacheEntry *entry )

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


Expand Down

0 comments on commit 895792a

Please sign in to comment.