[geos-commits] r2643 - trunk/source/operation/buffer

svn_geos at osgeo.org svn_geos at osgeo.org
Thu Oct 1 03:06:37 EDT 2009


Author: strk
Date: 2009-10-01 03:06:36 -0400 (Thu, 01 Oct 2009)
New Revision: 2643

Modified:
   trunk/source/operation/buffer/OffsetCurveBuilder.cpp
Log:
Fix trimming of left/right curves (ie: don't include the endcap)


Modified: trunk/source/operation/buffer/OffsetCurveBuilder.cpp
===================================================================
--- trunk/source/operation/buffer/OffsetCurveBuilder.cpp	2009-10-01 06:33:41 UTC (rev 2642)
+++ trunk/source/operation/buffer/OffsetCurveBuilder.cpp	2009-10-01 07:06:36 UTC (rev 2643)
@@ -167,9 +167,9 @@
    // NOTE: we take ownership of lineCoord here ...
    CoordinateSequence* lineCoord = vertexList->getCoordinates() ;
 
-   // [swong] April 24, 2008
-   // Left side:  index [n-2] to [endCapIndex]
-   // Right side: index [endCapIndex] to [n-2]
+   // [strk] Oct 1, 2009
+   // Left side:  index [n-1] to [endCapIndex]
+   // Right side: index [endCapIndex+1] to [n-2]
    // Where n is the last index (size-1).
    int n = lineCoord->size() - 1 ;
 
@@ -177,7 +177,7 @@
    if ( leftSide )
    {
       CoordinateArraySequence* coordSeq = new CoordinateArraySequence() ;
-      coordSeq->add( ( *lineCoord )[n-2] ) ;
+      //coordSeq->add( ( *lineCoord )[n-2] ) ;
       coordSeq->add( ( *lineCoord )[n-1] ) ;
       for ( int i = 0 ; i <= endCapIndex ; ++i )
       {
@@ -190,7 +190,7 @@
    if ( rightSide )
    {
       CoordinateArraySequence* coordSeq = new CoordinateArraySequence() ;
-      for ( int i = endCapIndex ; i <= n-2 ; ++i )
+      for ( int i = endCapIndex+1 ; i <= n-2 ; ++i )
       {
          coordSeq->add( ( *lineCoord )[i] ) ;
       }



More information about the geos-commits mailing list