@@ -423,20 +423,22 @@ QgsRect QgsVectorLayer::inverseProjectRect(const QgsRect& r) const
423
423
}
424
424
425
425
unsigned char * QgsVectorLayer::drawLineString (unsigned char * feature,
426
- bool hasZValue,
427
426
QPainter* p,
428
427
QgsMapToPixel* mtp,
429
428
bool projectionsEnabledFlag,
430
429
bool drawingToEditingCanvas)
431
430
{
432
431
unsigned char *ptr = feature + 5 ;
432
+ unsigned int wkbType = *((int *)(feature+1 ));
433
433
unsigned int nPoints = *((int *)ptr);
434
434
ptr = feature + 9 ;
435
+
436
+ bool hasZValue = (wkbType == QGis::WKBLineString25D);
435
437
436
438
std::vector<double > x (nPoints);
437
439
std::vector<double > y (nPoints);
438
440
std::vector<double > z (nPoints, 0.0 );
439
-
441
+
440
442
// Extract the points from the WKB format into the x and y vectors.
441
443
for (register unsigned int i = 0 ; i < nPoints; ++i)
442
444
{
@@ -523,7 +525,6 @@ unsigned char* QgsVectorLayer::drawLineString(unsigned char* feature,
523
525
}
524
526
525
527
unsigned char * QgsVectorLayer::drawPolygon (unsigned char * feature,
526
- bool hasZValue,
527
528
QPainter* p,
528
529
QgsMapToPixel* mtp,
529
530
bool projectionsEnabledFlag,
@@ -539,6 +540,10 @@ unsigned char* QgsVectorLayer::drawPolygon(unsigned char* feature,
539
540
if ( numRings == 0 ) // sanity check for zero rings in polygon
540
541
return feature + 9 ;
541
542
543
+ unsigned int wkbType = *((int *)(feature+1 ));
544
+
545
+ bool hasZValue = (wkbType == QGis::WKBPolygon25D);
546
+
542
547
int total_points = 0 ;
543
548
544
549
// A vector containing a pointer to a pair of double vectors.The
@@ -3413,7 +3418,6 @@ void QgsVectorLayer::drawFeature(QPainter* p,
3413
3418
case QGis::WKBLineString25D:
3414
3419
{
3415
3420
drawLineString (feature,
3416
- (wkbType == QGis::WKBLineString25D),
3417
3421
p,
3418
3422
theMapToPixelTransform,
3419
3423
projectionsEnabledFlag,
@@ -3426,11 +3430,10 @@ void QgsVectorLayer::drawFeature(QPainter* p,
3426
3430
unsigned char * ptr = feature + 5 ;
3427
3431
unsigned int numLineStrings = *((int *)ptr);
3428
3432
ptr = feature + 9 ;
3429
-
3433
+
3430
3434
for (register unsigned int jdx = 0 ; jdx < numLineStrings; jdx++)
3431
3435
{
3432
3436
ptr = drawLineString (ptr,
3433
- (wkbType == QGis::WKBMultiLineString25D),
3434
3437
p,
3435
3438
theMapToPixelTransform,
3436
3439
projectionsEnabledFlag,
@@ -3442,7 +3445,6 @@ void QgsVectorLayer::drawFeature(QPainter* p,
3442
3445
case QGis::WKBPolygon25D:
3443
3446
{
3444
3447
drawPolygon (feature,
3445
- (wkbType == QGis::WKBPolygon25D),
3446
3448
p,
3447
3449
theMapToPixelTransform,
3448
3450
projectionsEnabledFlag,
@@ -3457,7 +3459,6 @@ void QgsVectorLayer::drawFeature(QPainter* p,
3457
3459
ptr = feature + 9 ;
3458
3460
for (register unsigned int kdx = 0 ; kdx < numPolygons; kdx++)
3459
3461
ptr = drawPolygon (ptr,
3460
- (wkbType == QGis::WKBMultiPolygon25D),
3461
3462
p,
3462
3463
theMapToPixelTransform,
3463
3464
projectionsEnabledFlag,
0 commit comments