[QGIS Commit] r11532 - trunk/qgis/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Aug 31 06:17:59 EDT 2009


Author: mhugent
Date: 2009-08-31 06:17:58 -0400 (Mon, 31 Aug 2009)
New Revision: 11532

Modified:
   trunk/qgis/src/core/qgsvectorlayer.cpp
Log:
Apply coordinate clipping also for windows (probably fixes bug #1344)

Modified: trunk/qgis/src/core/qgsvectorlayer.cpp
===================================================================
--- trunk/qgis/src/core/qgsvectorlayer.cpp	2009-08-31 09:09:06 UTC (rev 11531)
+++ trunk/qgis/src/core/qgsvectorlayer.cpp	2009-08-31 10:17:58 UTC (rev 11532)
@@ -71,10 +71,7 @@
 #include "qgsvectoroverlay.h"
 #include "qgslogger.h"
 #include "qgsmaplayerregistry.h"
-
-#ifdef Q_WS_X11
 #include "qgsclipper.h"
-#endif
 
 #ifdef TESTPROVIDERLIB
 #include <dlfcn.h>
@@ -380,9 +377,7 @@
 
   transformPoints( x, y, z, renderContext );
 
-#if defined(Q_WS_X11)
-  // Work around a +/- 32768 limitation on coordinates in X11
-
+  // Work around a +/- 32768 limitation on coordinates
   // Look through the x and y coordinates and see if there are any
   // that need trimming. If one is found, there's no need to look at
   // the rest of them so end the loop at that point.
@@ -396,7 +391,6 @@
       break;
     }
   }
-#endif
 
   // set up QPolygonF class with transformed points
   QPolygonF pa( nPoints );
@@ -512,9 +506,7 @@
 
     transformPoints( ring->first, ring->second, zVector, renderContext );
 
-#if defined(Q_WS_X11)
-    // Work around a +/- 32768 limitation on coordinates in X11
-
+    // Work around a +/- 32768 limitation on coordinates
     // Look through the x and y coordinates and see if there are any
     // that need trimming. If one is found, there's no need to look at
     // the rest of them so end the loop at that point.
@@ -527,7 +519,6 @@
         break;
       }
     }
-#endif
 
     // Don't bother keeping the ring if it has been trimmed out of
     // existence.
@@ -3483,9 +3474,7 @@
   // executed, but never used, in a bit of code where performance is
   // critical).
   if ( ! fet.isValid() ) { return; }
-#if defined(Q_WS_X11)
   bool needToTrim = false;
-#endif
 
   QgsGeometry* geom = fet.geometry();
   unsigned char* feature = geom->asWkb();
@@ -3501,6 +3490,12 @@
       double y = *(( double * )( feature + 5 + sizeof( double ) ) );
 
       transformPoint( x, y, &renderContext.mapToPixel(), renderContext.coordinateTransform() );
+      if ( std::abs( x ) > QgsClipper::MAX_X ||
+             std::abs( y ) > QgsClipper::MAX_Y )
+      {
+        break;
+      }
+
       //QPointF pt(x - (marker->width()/2),  y - (marker->height()/2));
       QPointF pt( x*renderContext.rasterScaleFactor() - ( marker->width() / 2 ),
                   y*renderContext.rasterScaleFactor() - ( marker->height() / 2 ) );
@@ -3542,13 +3537,11 @@
                     y*renderContext.rasterScaleFactor() - ( marker->height() / 2 ) );
         //QPointF pt( x, y );
 
-#if defined(Q_WS_X11)
-        // Work around a +/- 32768 limitation on coordinates in X11
+        // Work around a +/- 32768 limitation on coordinates
         if ( std::abs( x ) > QgsClipper::MAX_X ||
              std::abs( y ) > QgsClipper::MAX_Y )
           needToTrim = true;
         else
-#endif
           p->drawImage( pt, *marker );
       }
       p->restore();



More information about the QGIS-commit mailing list