Skip to content

Commit 93fc059

Browse files
author
mhugent
committedJan 28, 2011
Fix line coordinate transform
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15095 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
 

‎src/core/qgsclipper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ unsigned char* QgsClipper::clippedLineWKB( unsigned char* wkb, const QgsRectangl
8585
if ( clipLineSegment( clipExtent.xMinimum(), clipExtent.xMaximum(), clipExtent.yMinimum(), clipExtent.yMaximum(),
8686
p0x, p0y, p1x_c, p1y_c ) )
8787
{
88-
bool newLine = line.size() > 0 && ( p1x_c != lastClipX || p1y_c != lastClipY );
88+
bool newLine = line.size() > 0 && ( p0x != lastClipX || p0y != lastClipY );
8989
if ( newLine )
9090
{
9191
//add edge points to connect old and new line

‎src/core/symbology-ng/qgsrendererv2.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,10 @@ unsigned char* QgsFeatureRendererV2::_getLineString( QPolygonF& pts, QgsRenderCo
5353
wkb += sizeof( unsigned int );
5454

5555
bool hasZValue = ( wkbType == QGis::WKBLineString25D );
56-
double x, y;
56+
double x, y, z;
5757

5858
const QgsCoordinateTransform* ct = context.coordinateTransform();
5959
const QgsMapToPixel& mtp = context.mapToPixel();
60-
double z = 0; // dummy variable for coordiante transform
6160

6261
//apply clipping for large lines to achieve a better rendering performance
6362
if ( nPoints > 100 )
@@ -89,7 +88,10 @@ unsigned char* QgsFeatureRendererV2::_getLineString( QPolygonF& pts, QgsRenderCo
8988
for ( unsigned int i = 0; i < pts.size(); ++i )
9089
{
9190
if ( ct )
91+
{
92+
z = 0;
9293
ct->transformInPlace( pts[i].rx(), pts[i].ry(), z );
94+
}
9395
mtp.transformInPlace( pts[i].rx(), pts[i].ry() );
9496
}
9597

0 commit comments

Comments
 (0)
Please sign in to comment.