Skip to content

Commit d1aff82

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

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
@@ -885,6 +885,9 @@ void QgsMarkerLineSymbolLayerV2::renderPolyline( const QPolygonF& points, QgsSym
885885
}
886886
}
887887

888+
889+
context.renderContext().painter()->save();
890+
888891
if ( qgsDoubleNear( offset, 0.0 ) )
889892
{
890893
if ( placement == Interval )
@@ -911,6 +914,8 @@ void QgsMarkerLineSymbolLayerV2::renderPolyline( const QPolygonF& points, QgsSym
911914
renderPolylineVertex( points2, context, placement );
912915
}
913916
}
917+
918+
context.renderContext().painter()->restore();
914919
}
915920

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

0 commit comments

Comments
 (0)
Please sign in to comment.