Skip to content
Permalink
Browse files

Fix #9698 (magnified SVG symbols with data-defined rotation)

  • Loading branch information
wonder-sk committed Mar 4, 2014
1 parent 9774abd commit 86ea4bf39a9535b6524e015fb7e1a1975d2cd6e9
Showing with 16 additions and 0 deletions.
  1. +16 −0 src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
@@ -32,6 +32,19 @@

#include <cmath>

Q_GUI_EXPORT extern int qt_defaultDpiX();
Q_GUI_EXPORT extern int qt_defaultDpiY();

static void _fixQPictureDPI( QPainter* p )
{
// QPicture makes an assumption that we drawing to it with system DPI.
// Then when being drawn, it scales the painter. The following call
// negates the effect. There is no way of setting QPicture's DPI.
// See QTBUG-20361
p->scale(( double )qt_defaultDpiX() / p->device()->logicalDpiX(),
( double )qt_defaultDpiY() / p->device()->logicalDpiY() );
}

//////

QgsSimpleMarkerSymbolLayerV2::QgsSimpleMarkerSymbolLayerV2( QString name, QColor color, QColor borderColor, double size, double angle, QgsSymbolV2::ScaleMethod scaleMethod )
@@ -1189,7 +1202,10 @@ void QgsSvgMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Re

if ( pct.width() > 1 )
{
p->save();
_fixQPictureDPI( p );
p->drawPicture( 0, 0, pct );
p->restore();
hwRatio = ( double )pct.height() / ( double )pct.width();
}
}

0 comments on commit 86ea4bf

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