Support @value in diagram property expressions

This commit is contained in:
Nyall Dawson 2017-01-02 11:31:35 +10:00
parent 43a328687d
commit 5e9f6ac5cc

View File

@ -444,9 +444,13 @@ void QgsDiagramRenderer::renderDiagram( const QgsFeature& feature, QgsRenderCont
if ( properties.hasActiveProperties() )
{
c.expressionContext().setOriginalValueVariable( s.transparency );
s.transparency = properties.valueAsInt( QgsDiagramLayerSettings::Opacity, c.expressionContext(), s.transparency );
c.expressionContext().setOriginalValueVariable( QgsSymbolLayerUtils::encodeColor( s.backgroundColor ) );
s.backgroundColor = properties.valueAsColor( QgsDiagramLayerSettings::BackgroundColor, c.expressionContext(), s.backgroundColor );
c.expressionContext().setOriginalValueVariable( QgsSymbolLayerUtils::encodeColor( s.penColor ) );
s.penColor = properties.valueAsColor( QgsDiagramLayerSettings::OutlineColor, c.expressionContext(), s.penColor );
c.expressionContext().setOriginalValueVariable( s.penWidth );
s.penWidth = properties.valueAsDouble( QgsDiagramLayerSettings::OutlineWidth, c.expressionContext(), s.penWidth );
}