[QGIS Commit] r14843 - branches/threading-branch/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Dec 5 15:00:30 EST 2010


Author: wonder
Date: 2010-12-05 12:00:30 -0800 (Sun, 05 Dec 2010)
New Revision: 14843

Modified:
   branches/threading-branch/src/core/qgsmaprenderer.cpp
Log:
Do changes to map renderer context only in rendering routines to avoid overwriting by newer values


Modified: branches/threading-branch/src/core/qgsmaprenderer.cpp
===================================================================
--- branches/threading-branch/src/core/qgsmaprenderer.cpp	2010-12-05 19:22:04 UTC (rev 14842)
+++ branches/threading-branch/src/core/qgsmaprenderer.cpp	2010-12-05 20:00:30 UTC (rev 14843)
@@ -152,12 +152,9 @@
   int myHeight = next.size.height();
   int myWidth = next.size.width();
 
-  QgsMapToPixel newCoordXForm;
-
   if ( !myWidth || !myHeight )
   {
     next.scale = 1;
-    newCoordXForm.setParameters( 0, 0, 0, 0 );
     return;
   }
 
@@ -204,10 +201,6 @@
   updateScale();
 
   QgsDebugMsg( QString( "Scale (assuming meters as map units) = 1:%1" ).arg( next.scale ) );
-
-  newCoordXForm.setParameters( next.mapUnitsPerPixel, dxmin, dymin, myHeight );
-  mRenderContext.setMapToPixel( newCoordXForm );
-  mRenderContext.setExtent( next.extent );
 }
 
 
@@ -226,6 +219,11 @@
   mRenderTime.start();
 #endif
 
+  QgsMapToPixel coordXForm;
+  coordXForm.setParameters( next.mapUnitsPerPixel, curr.extent.xMinimum(), curr.extent.yMinimum(), curr.size.height() );
+  mRenderContext.setMapToPixel( coordXForm );
+
+  mRenderContext.setExtent( curr.extent );
   mRenderContext.setDrawEditingInformation( !curr.hints.testFlag( DrawEditingInformation ) );
   mRenderContext.setPainter( painter );
   mRenderContext.setCoordinateTransform( 0 );



More information about the QGIS-commit mailing list