Skip to content

Commit

Permalink
sqrt symbol size for ScaleArea before scale to context units, fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Feb 9, 2014
1 parent 77a24cb commit 71c1ad1
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
Expand Up @@ -512,7 +512,6 @@ void QgsSimpleMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV
{
scaledSize = sizeExpression->evaluate( const_cast<QgsFeature*>( context.feature() ) ).toDouble();
}
scaledSize *= QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mSizeUnit );

switch ( mScaleMethod )
{
Expand All @@ -523,6 +522,8 @@ void QgsSimpleMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV
break;
}

scaledSize *= QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mSizeUnit );

double half = scaledSize / 2.0;
transform.scale( half, half );
}
Expand Down Expand Up @@ -756,7 +757,6 @@ bool QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
{
size = sizeExpression->evaluate( const_cast<QgsFeature*>( context->feature() ) ).toDouble();
}
size *= QgsSymbolLayerV2Utils::lineWidthScaleFactor( context->renderContext(), mSizeUnit );

switch ( mScaleMethod )
{
Expand All @@ -766,6 +766,8 @@ bool QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
case QgsSymbolV2::ScaleDiameter:
break;
}

size *= QgsSymbolLayerV2Utils::lineWidthScaleFactor( context->renderContext(), mSizeUnit );
}
if ( mSizeUnit == QgsSymbolV2::MM )
{
Expand Down Expand Up @@ -1081,7 +1083,6 @@ void QgsSvgMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Re
{
size = sizeExpression->evaluate( const_cast<QgsFeature*>( context.feature() ) ).toDouble();
}
size *= QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mSizeUnit );

if ( hasDataDefinedSize )
{
Expand All @@ -1094,6 +1095,7 @@ void QgsSvgMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Re
break;
}
}
size *= QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mSizeUnit );

//don't render symbols with size below one or above 10,000 pixels
if (( int )size < 1 || 10000.0 < size )
Expand Down Expand Up @@ -1358,10 +1360,6 @@ bool QgsSvgMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitScale
{
size = sizeExpression->evaluate( *f ).toDouble();
}
if ( mSizeUnit == QgsSymbolV2::MM )
{
size *= mmMapUnitScaleFactor;
}

if ( hasDataDefinedSize )
{
Expand All @@ -1375,6 +1373,11 @@ bool QgsSvgMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitScale
}
}

if ( mSizeUnit == QgsSymbolV2::MM )
{
size *= mmMapUnitScaleFactor;
}

double halfSize = size / 2.0;

//offset, angle
Expand Down

0 comments on commit 71c1ad1

Please sign in to comment.