@@ -702,8 +702,7 @@ bool QgsVectorLayer::draw( QgsRenderContext& rendererContext )
702
702
.setSubsetOfAttributes ( attributes );
703
703
704
704
// enable the simplification of the geometries (Using the current map2pixel context) before send it to renderer engine.
705
- mCurrentRendererContext = &rendererContext;
706
- if ( simplifyDrawingCanbeApplied ( QgsVectorLayer::GeometrySimplification ) )
705
+ if ( simplifyDrawingCanbeApplied ( rendererContext, QgsVectorLayer::GeometrySimplification ) )
707
706
{
708
707
QPainter* p = rendererContext.painter ();
709
708
double dpi = ( p->device ()->logicalDpiX () + p->device ()->logicalDpiY () ) / 2 ;
@@ -749,7 +748,6 @@ bool QgsVectorLayer::draw( QgsRenderContext& rendererContext )
749
748
else
750
749
drawRendererV2 ( fit, rendererContext, labeling );
751
750
752
- mCurrentRendererContext = NULL ;
753
751
return true ;
754
752
}
755
753
@@ -1259,14 +1257,14 @@ bool QgsVectorLayer::setSubsetString( QString subset )
1259
1257
return res;
1260
1258
}
1261
1259
1262
- bool QgsVectorLayer::simplifyDrawingCanbeApplied ( int simplifyHint ) const
1260
+ bool QgsVectorLayer::simplifyDrawingCanbeApplied ( const QgsRenderContext& renderContext, int simplifyHint ) const
1263
1261
{
1264
- if ( mDataProvider && !mEditBuffer && ( hasGeometryType () && geometryType () != QGis::Point ) && ( mSimplifyMethod .simplifyHints () & simplifyHint ) && ( ! mCurrentRendererContext || mCurrentRendererContext -> useRenderingOptimization () ) )
1262
+ if ( mDataProvider && !mEditBuffer && ( hasGeometryType () && geometryType () != QGis::Point ) && ( mSimplifyMethod .simplifyHints () & simplifyHint ) && renderContext. useRenderingOptimization () )
1265
1263
{
1266
1264
double maximumSimplificationScale = mSimplifyMethod .maximumScale ();
1267
1265
1268
1266
// check maximum scale at which generalisation should be carried out
1269
- if ( mCurrentRendererContext && maximumSimplificationScale > 1 && mCurrentRendererContext -> rendererScale () <= maximumSimplificationScale )
1267
+ if ( maximumSimplificationScale > 1 && renderContext. rendererScale () <= maximumSimplificationScale )
1270
1268
return false ;
1271
1269
1272
1270
return true ;
0 commit comments