Skip to content

Commit bec7cdd

Browse files
committedOct 17, 2016
Fix bad fills when using marker line with render effects (fix #15696)
(cherry-picked from a0bfc10, 55f207)
1 parent e15c93d commit bec7cdd

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
 

‎src/core/effects/qgspainteffect.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ void QgsPaintEffect::end( QgsRenderContext &context )
162162
context.setPainter( mPrevPainter );
163163
mPrevPainter = nullptr;
164164

165+
// clear any existing pen/brush - sometimes these are not correctly restored when restoring a painter
166+
// with a QPicture destination - see #15696
167+
context.painter()->setPen( Qt::NoPen );
168+
context.painter()->setBrush( Qt::NoBrush );
169+
165170
//draw using effect
166171
render( *mTempPicture, context );
167172

‎src/core/symbology-ng/qgslinesymbollayerv2.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,9 @@ void QgsMarkerLineSymbolLayerV2::renderPolyline( const QPolygonF& points, QgsSym
889889
}
890890
}
891891

892+
893+
context.renderContext().painter()->save();
894+
892895
if ( qgsDoubleNear( offset, 0.0 ) )
893896
{
894897
if ( placement == Interval )
@@ -915,6 +918,8 @@ void QgsMarkerLineSymbolLayerV2::renderPolyline( const QPolygonF& points, QgsSym
915918
renderPolylineVertex( points2, context, placement );
916919
}
917920
}
921+
922+
context.renderContext().painter()->restore();
918923
}
919924

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

0 commit comments

Comments
 (0)