Skip to content
Permalink
Browse files

Fix line coordinate transform

git-svn-id: http://svn.osgeo.org/qgis/trunk@15095 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Jan 28, 2011
1 parent 58bd7ac commit 8ddf155d59096f13e97d97aa2cf5bc439e9ce36d
Showing with 5 additions and 3 deletions.
  1. +1 −1 src/core/qgsclipper.cpp
  2. +4 −2 src/core/symbology-ng/qgsrendererv2.cpp
@@ -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
@@ -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 )
@@ -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() );
}

0 comments on commit 8ddf155

Please sign in to comment.
You can’t perform that action at this time.