[QGIS Commit] r11911 - trunk/qgis/src/plugins/evis/eventbrowser

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Nov 3 13:08:57 EST 2009


Author: timlinux
Date: 2009-11-03 13:08:57 -0500 (Tue, 03 Nov 2009)
New Revision: 11911

Modified:
   trunk/qgis/src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.cpp
Log:
Dont pan if next point is in current extent (so we can take advantage of render caching

Modified: trunk/qgis/src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.cpp
===================================================================
--- trunk/qgis/src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.cpp	2009-11-03 18:00:20 UTC (rev 11910)
+++ trunk/qgis/src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.cpp	2009-11-03 18:08:57 UTC (rev 11911)
@@ -540,7 +540,11 @@
       //keep the extent the same just center the map canvas in the display so our feature is in the middle
       QgsRectangle myRect( myPoint.x( ) - ( mCanvas->extent( ).width( ) / 2 ), myPoint.y( ) - ( mCanvas->extent( ).height( ) / 2 ), myPoint.x( ) + ( mCanvas->extent( ).width( ) / 2 ), myPoint.y( ) + ( mCanvas->extent( ).height( ) / 2 ) );
 
-      mCanvas->setExtent( myRect );
+      // only change the extents if the point is beyond the current extents to minimise repaints
+      if ( !mCanvas->extent().contains( myPoint ) )
+      {
+        mCanvas->setExtent( myRect );
+      }
       mCanvas->refresh( );
     }
   }



More information about the QGIS-commit mailing list