Skip to content

Commit

Permalink
Fix bad fills when using marker line with render effects (fix #15696)
Browse files Browse the repository at this point in the history
(cherry-picked from a0bfc10, 55f207)
  • Loading branch information
nyalldawson committed Oct 17, 2016
1 parent 11627e8 commit d1aff82
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/effects/qgspainteffect.cpp
Expand Up @@ -162,6 +162,11 @@ void QgsPaintEffect::end( QgsRenderContext &context )
context.setPainter( mPrevPainter );
mPrevPainter = nullptr;

// clear any existing pen/brush - sometimes these are not correctly restored when restoring a painter
// with a QPicture destination - see #15696
context.painter()->setPen( Qt::NoPen );
context.painter()->setBrush( Qt::NoBrush );

//draw using effect
render( *mTempPicture, context );

Expand Down
5 changes: 5 additions & 0 deletions src/core/symbology-ng/qgslinesymbollayerv2.cpp
Expand Up @@ -885,6 +885,9 @@ void QgsMarkerLineSymbolLayerV2::renderPolyline( const QPolygonF& points, QgsSym
}
}


context.renderContext().painter()->save();

if ( qgsDoubleNear( offset, 0.0 ) )
{
if ( placement == Interval )
Expand All @@ -911,6 +914,8 @@ void QgsMarkerLineSymbolLayerV2::renderPolyline( const QPolygonF& points, QgsSym
renderPolylineVertex( points2, context, placement );
}
}

context.renderContext().painter()->restore();
}

void QgsMarkerLineSymbolLayerV2::renderPolygonOutline( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context )
Expand Down

0 comments on commit d1aff82

Please sign in to comment.