Skip to content

Commit

Permalink
Fix line coordinate transform
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15095 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jan 28, 2011
1 parent bd86844 commit 93fc059
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/qgsclipper.cpp
Expand Up @@ -85,7 +85,7 @@ unsigned char* QgsClipper::clippedLineWKB( unsigned char* wkb, const QgsRectangl
if ( clipLineSegment( clipExtent.xMinimum(), clipExtent.xMaximum(), clipExtent.yMinimum(), clipExtent.yMaximum(),
p0x, p0y, p1x_c, p1y_c ) )
{
bool newLine = line.size() > 0 && ( p1x_c != lastClipX || p1y_c != lastClipY );
bool newLine = line.size() > 0 && ( p0x != lastClipX || p0y != lastClipY );
if ( newLine )
{
//add edge points to connect old and new line
Expand Down
6 changes: 4 additions & 2 deletions src/core/symbology-ng/qgsrendererv2.cpp
Expand Up @@ -53,11 +53,10 @@ unsigned char* QgsFeatureRendererV2::_getLineString( QPolygonF& pts, QgsRenderCo
wkb += sizeof( unsigned int );

bool hasZValue = ( wkbType == QGis::WKBLineString25D );
double x, y;
double x, y, z;

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

//apply clipping for large lines to achieve a better rendering performance
if ( nPoints > 100 )
Expand Down Expand Up @@ -89,7 +88,10 @@ unsigned char* QgsFeatureRendererV2::_getLineString( QPolygonF& pts, QgsRenderCo
for ( unsigned int i = 0; i < pts.size(); ++i )
{
if ( ct )
{
z = 0;
ct->transformInPlace( pts[i].rx(), pts[i].ry(), z );
}
mtp.transformInPlace( pts[i].rx(), pts[i].ry() );
}

Expand Down

0 comments on commit 93fc059

Please sign in to comment.