Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix #10512 (missing propagation of fields/scale to sub-symbols)
  • Loading branch information
wonder-sk committed Jun 9, 2014
1 parent a715ce6 commit 7b9fc8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions src/core/symbology-ng/qgsfillsymbollayerv2.cpp
Expand Up @@ -723,7 +723,7 @@ void QgsGradientFillSymbolLayerV2::startRender( QgsSymbolV2RenderContext& contex
mSelBrush = QBrush( selColor );

//update mBrush to use a gradient fill with specified properties
prepareExpressions( context.fields() );
prepareExpressions( context.fields(), context.renderContext().rendererScale() );
}

void QgsGradientFillSymbolLayerV2::stopRender( QgsSymbolV2RenderContext& context )
Expand Down Expand Up @@ -999,7 +999,7 @@ void QgsShapeburstFillSymbolLayerV2::startRender( QgsSymbolV2RenderContext& cont
if ( ! selectionIsOpaque ) selColor.setAlphaF( context.alpha() );
mSelBrush = QBrush( selColor );

prepareExpressions( context.fields() );
prepareExpressions( context.fields(), context.renderContext().rendererScale() );
}

void QgsShapeburstFillSymbolLayerV2::stopRender( QgsSymbolV2RenderContext& context )
Expand Down Expand Up @@ -1799,7 +1799,7 @@ void QgsSVGFillSymbolLayer::startRender( QgsSymbolV2RenderContext& context )

if ( mOutline )
{
mOutline->startRender( context.renderContext() );
mOutline->startRender( context.renderContext(), context.fields() );
}

prepareExpressions( context.fields(), context.renderContext().rendererScale() );
Expand Down Expand Up @@ -2531,7 +2531,7 @@ void QgsLinePatternFillSymbolLayer::applyPattern( const QgsSymbolV2RenderContext
lineRenderContext.setMapToPixel( mtp );
lineRenderContext.setForceVectorOutput( false );

fillLineSymbol->startRender( lineRenderContext );
fillLineSymbol->startRender( lineRenderContext, context.fields() );

QVector<QPolygonF> polygons;
polygons.append( QPolygonF() << p1 << p2 );
Expand Down Expand Up @@ -2577,7 +2577,7 @@ void QgsLinePatternFillSymbolLayer::startRender( QgsSymbolV2RenderContext& conte

if ( mFillLineSymbol )
{
mFillLineSymbol->startRender( context.renderContext() );
mFillLineSymbol->startRender( context.renderContext(), context.fields() );
}

prepareExpressions( context.fields(), context.renderContext().rendererScale() );
Expand Down Expand Up @@ -2947,14 +2947,15 @@ void QgsPointPatternFillSymbolLayer::applyPattern( const QgsSymbolV2RenderContex

//marker rendering needs context for drawing on patternImage
QgsRenderContext pointRenderContext;
pointRenderContext.setRendererScale( context.renderContext().rendererScale() );
pointRenderContext.setPainter( &p );
pointRenderContext.setRasterScaleFactor( 1.0 );
pointRenderContext.setScaleFactor( context.renderContext().scaleFactor() * context.renderContext().rasterScaleFactor() );
QgsMapToPixel mtp( context.renderContext().mapToPixel().mapUnitsPerPixel() / context.renderContext().rasterScaleFactor() );
pointRenderContext.setMapToPixel( mtp );
pointRenderContext.setForceVectorOutput( false );

mMarkerSymbol->startRender( pointRenderContext );
mMarkerSymbol->startRender( pointRenderContext, context.fields() );

//render corner points
mMarkerSymbol->renderPoint( QPointF( 0, 0 ), context.feature(), pointRenderContext );
Expand Down Expand Up @@ -2995,7 +2996,7 @@ void QgsPointPatternFillSymbolLayer::startRender( QgsSymbolV2RenderContext& cont

if ( mOutline )
{
mOutline->startRender( context.renderContext() );
mOutline->startRender( context.renderContext(), context.fields() );
}
prepareExpressions( context.fields(), context.renderContext().rendererScale() );
}
Expand Down Expand Up @@ -3188,7 +3189,7 @@ void QgsCentroidFillSymbolLayerV2::setColor( const QColor& color )
void QgsCentroidFillSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context )
{
mMarker->setAlpha( context.alpha() );
mMarker->startRender( context.renderContext() );
mMarker->startRender( context.renderContext(), context.fields() );
}

void QgsCentroidFillSymbolLayerV2::stopRender( QgsSymbolV2RenderContext& context )
Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgsvectorfieldsymbollayer.cpp
Expand Up @@ -195,7 +195,7 @@ void QgsVectorFieldSymbolLayer::startRender( QgsSymbolV2RenderContext& context )
{
if ( mLineSymbol )
{
mLineSymbol->startRender( context.renderContext() );
mLineSymbol->startRender( context.renderContext(), context.fields() );
}

const QgsFields* fields = context.fields();
Expand Down

0 comments on commit 7b9fc8f

Please sign in to comment.