Skip to content

Commit

Permalink
[labeling] Fix broken data defined shape radius setting
Browse files Browse the repository at this point in the history
(cherry-picked from 2345852)
  • Loading branch information
nyalldawson committed Mar 1, 2018
1 parent 4bbea2f commit d665cd5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/core/qgspallabeling.cpp
Expand Up @@ -2186,6 +2186,17 @@ bool QgsPalLayerSettings::dataDefinedValEval( DataDefinedValueType valType,
}
return false;
}
case DDSizeF:
{
QString ptstr = exprVal.toString().trimmed();

if ( !ptstr.isEmpty() )
{
dataDefinedValues.insert( p, QVariant( QgsSymbolLayerUtils::decodeSize( ptstr ) ) );
return true;
}
return false;
}
}
}
return false;
Expand Down Expand Up @@ -2671,7 +2682,7 @@ void QgsPalLayerSettings::parseShapeBackground( QgsRenderContext &context )
dataDefinedValEval( DDUnits, QgsPalLayerSettings::ShapeOffsetUnits, exprVal, context.expressionContext() );

// data defined shape radii?
dataDefinedValEval( DDPointF, QgsPalLayerSettings::ShapeRadii, exprVal, context.expressionContext(), QgsSymbolLayerUtils::encodeSize( background.radii() ) );
dataDefinedValEval( DDSizeF, QgsPalLayerSettings::ShapeRadii, exprVal, context.expressionContext(), QgsSymbolLayerUtils::encodeSize( background.radii() ) );

// data defined shape radii units?
dataDefinedValEval( DDUnits, QgsPalLayerSettings::ShapeRadiiUnits, exprVal, context.expressionContext() );
Expand Down
3 changes: 2 additions & 1 deletion src/core/qgspallabeling.h
Expand Up @@ -847,7 +847,8 @@ class CORE_EXPORT QgsPalLayerSettings
DDColor,
DDJoinStyle,
DDBlendMode,
DDPointF
DDPointF,
DDSizeF, //!< Data defined size
};

// convenience data defined evaluation function
Expand Down

0 comments on commit d665cd5

Please sign in to comment.