71
71
#include " qgsvectoroverlay.h"
72
72
#include " qgslogger.h"
73
73
#include " qgsmaplayerregistry.h"
74
-
75
- #ifdef Q_WS_X11
76
74
#include " qgsclipper.h"
77
- #endif
78
75
79
76
#ifdef TESTPROVIDERLIB
80
77
#include < dlfcn.h>
@@ -380,9 +377,7 @@ unsigned char *QgsVectorLayer::drawLineString( unsigned char *feature, QgsRender
380
377
381
378
transformPoints ( x, y, z, renderContext );
382
379
383
- #if defined(Q_WS_X11)
384
- // Work around a +/- 32768 limitation on coordinates in X11
385
-
380
+ // Work around a +/- 32768 limitation on coordinates
386
381
// Look through the x and y coordinates and see if there are any
387
382
// that need trimming. If one is found, there's no need to look at
388
383
// the rest of them so end the loop at that point.
@@ -396,7 +391,6 @@ unsigned char *QgsVectorLayer::drawLineString( unsigned char *feature, QgsRender
396
391
break ;
397
392
}
398
393
}
399
- #endif
400
394
401
395
// set up QPolygonF class with transformed points
402
396
QPolygonF pa ( nPoints );
@@ -512,9 +506,7 @@ unsigned char *QgsVectorLayer::drawPolygon( unsigned char *feature, QgsRenderCon
512
506
513
507
transformPoints ( ring->first , ring->second , zVector, renderContext );
514
508
515
- #if defined(Q_WS_X11)
516
- // Work around a +/- 32768 limitation on coordinates in X11
517
-
509
+ // Work around a +/- 32768 limitation on coordinates
518
510
// Look through the x and y coordinates and see if there are any
519
511
// that need trimming. If one is found, there's no need to look at
520
512
// the rest of them so end the loop at that point.
@@ -527,7 +519,6 @@ unsigned char *QgsVectorLayer::drawPolygon( unsigned char *feature, QgsRenderCon
527
519
break ;
528
520
}
529
521
}
530
- #endif
531
522
532
523
// Don't bother keeping the ring if it has been trimmed out of
533
524
// existence.
@@ -3483,9 +3474,7 @@ void QgsVectorLayer::drawFeature( QgsRenderContext &renderContext,
3483
3474
// executed, but never used, in a bit of code where performance is
3484
3475
// critical).
3485
3476
if ( ! fet.isValid () ) { return ; }
3486
- #if defined(Q_WS_X11)
3487
3477
bool needToTrim = false ;
3488
- #endif
3489
3478
3490
3479
QgsGeometry* geom = fet.geometry ();
3491
3480
unsigned char * feature = geom->asWkb ();
@@ -3501,6 +3490,12 @@ void QgsVectorLayer::drawFeature( QgsRenderContext &renderContext,
3501
3490
double y = *(( double * )( feature + 5 + sizeof ( double ) ) );
3502
3491
3503
3492
transformPoint ( x, y, &renderContext.mapToPixel (), renderContext.coordinateTransform () );
3493
+ if ( std::abs ( x ) > QgsClipper::MAX_X ||
3494
+ std::abs ( y ) > QgsClipper::MAX_Y )
3495
+ {
3496
+ break ;
3497
+ }
3498
+
3504
3499
// QPointF pt(x - (marker->width()/2), y - (marker->height()/2));
3505
3500
QPointF pt ( x*renderContext.rasterScaleFactor () - ( marker->width () / 2 ),
3506
3501
y*renderContext.rasterScaleFactor () - ( marker->height () / 2 ) );
@@ -3542,13 +3537,11 @@ void QgsVectorLayer::drawFeature( QgsRenderContext &renderContext,
3542
3537
y*renderContext.rasterScaleFactor () - ( marker->height () / 2 ) );
3543
3538
// QPointF pt( x, y );
3544
3539
3545
- #if defined(Q_WS_X11)
3546
- // Work around a +/- 32768 limitation on coordinates in X11
3540
+ // Work around a +/- 32768 limitation on coordinates
3547
3541
if ( std::abs ( x ) > QgsClipper::MAX_X ||
3548
3542
std::abs ( y ) > QgsClipper::MAX_Y )
3549
3543
needToTrim = true ;
3550
3544
else
3551
- #endif
3552
3545
p->drawImage ( pt, *marker );
3553
3546
}
3554
3547
p->restore ();
0 commit comments