Skip to content
Permalink
Browse files
Draw svg symbols as vectors if there is rotation
  • Loading branch information
mhugent committed Feb 14, 2012
1 parent 1dfc3b7 commit 895792a5f64636a4994580914cc30fb840256d29
Showing with 5 additions and 3 deletions.
  1. +4 −2 src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
  2. +1 −1 src/core/symbology-ng/qgssvgcache.cpp
@@ -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() );
@@ -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 ) );


0 comments on commit 895792a

Please sign in to comment.