Skip to content

Commit

Permalink
partly revert 1d5712c
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jul 25, 2013
1 parent 46db30c commit 3c5980c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp
Expand Up @@ -188,7 +188,7 @@ QgsSymbolV2* QgsCategorizedSymbolRendererV2::symbolForValue( QVariant value )
}
else
{
QgsDebugMsg( "attribute value not found: " + value.toString() );
QgsDebugMsgLevel( "attribute value not found: " + value.toString(), 3 );
}
return NULL;
}
Expand Down
36 changes: 25 additions & 11 deletions src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
Expand Up @@ -462,21 +462,35 @@ void QgsSimpleMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV
// move to the desired position
transform.translate( point.x() + off.x(), point.y() + off.y() );

bool hasDataDefinedRotation = context.renderHints() & QgsSymbolV2::DataDefinedRotation || angleExpression;
if ( angle != 0 && hasDataDefinedRotation )
transform.rotate( angle );

double size = mSize;
QgsExpression* sizeExpression = expression( "size" );
QgsExpression *sizeExpression = expression( "size" );
bool hasDataDefinedSize = context.renderHints() & QgsSymbolV2::DataDefinedSizeScale || sizeExpression;

if ( sizeExpression )
// resize if necessary
if ( hasDataDefinedSize )
{
size = sizeExpression->evaluate( const_cast<QgsFeature*>( context.feature() ) ).toDouble();
double scaledSize = mSize;
if ( sizeExpression )
{
scaledSize = sizeExpression->evaluate( const_cast<QgsFeature*>( context.feature() ) ).toDouble();
}
scaledSize *= QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mSizeUnit );

switch ( mScaleMethod )
{
case QgsSymbolV2::ScaleArea:
scaledSize = sqrt( scaledSize );
break;
case QgsSymbolV2::ScaleDiameter:
break;
}

double half = scaledSize / 2.0;
transform.scale( half, half );
}
size *= QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mSizeUnit );

double half = size / 2.0;
transform.scale( half, half );
bool hasDataDefinedRotation = context.renderHints() & QgsSymbolV2::DataDefinedRotation || angleExpression;
if ( angle != 0 && hasDataDefinedRotation )
transform.rotate( angle );

QgsExpression* colorExpression = expression( "color" );
QgsExpression* colorBorderExpression = expression( "color_border" );
Expand Down

0 comments on commit 3c5980c

Please sign in to comment.