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 e15c93d commit bec7cdd
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,9 @@ void QgsMarkerLineSymbolLayerV2::renderPolyline( const QPolygonF& points, QgsSym
}
}


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

if ( qgsDoubleNear( offset, 0.0 ) )
{
if ( placement == Interval )
Expand All @@ -915,6 +918,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 bec7cdd

Please sign in to comment.