Skip to content

Commit

Permalink
Fix data defined rotation detection
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Dec 9, 2019
1 parent ef24c52 commit 9afc41e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/core/symbology/qgsmarkersymbollayer.cpp
Expand Up @@ -645,18 +645,24 @@ void QgsSimpleMarkerSymbolLayerBase::calculateOffsetAndRotation( QgsSymbolRender
markerOffset( context, scaledSize, scaledSize, offsetX, offsetY );
offset = QPointF( offsetX, offsetY );

hasDataDefinedRotation = false;
//angle
bool ok = true;
angle = mAngle + mLineAngle;
bool usingDataDefinedRotation = false;
if ( mDataDefinedProperties.isActive( QgsSymbolLayer::PropertyAngle ) )
{
context.setOriginalValueVariable( angle );
angle = mDataDefinedProperties.valueAsDouble( QgsSymbolLayer::PropertyAngle, context.renderContext().expressionContext(), mAngle, &ok ) + mLineAngle;
usingDataDefinedRotation = ok;

// If the expression evaluation was not successful, fallback to static value
if ( !ok )
angle = mAngle + mLineAngle;

hasDataDefinedRotation = true;
}

hasDataDefinedRotation = context.renderHints() & QgsSymbol::DynamicRotation || usingDataDefinedRotation;
hasDataDefinedRotation = context.renderHints() & QgsSymbol::DynamicRotation || hasDataDefinedRotation;

if ( hasDataDefinedRotation )
{
// For non-point markers, "dataDefinedRotation" means following the
Expand Down

0 comments on commit 9afc41e

Please sign in to comment.