Skip to content

Commit 54607d3

Browse files
Withalionnyalldawson
authored andcommitted
Fix wrong index point addition in polygon geometries
1 parent 3b9eb96 commit 54607d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/3d/qgsrubberband3d.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ void QgsRubberBand3D::addPoint( const QgsPoint &pt )
315315
if ( QgsPolygon *polygon = qgsgeometry_cast<QgsPolygon *>( mGeometry.constGet() ) )
316316
{
317317
QgsLineString *exteriorRing = qgsgeometry_cast<QgsLineString *>( polygon->exteriorRing() );
318-
const int lastVertexIndex = exteriorRing->numPoints() - 2;
318+
const int lastVertexIndex = exteriorRing->numPoints() - 1;
319319
exteriorRing->insertVertex( QgsVertexId( 0, 0, lastVertexIndex ), pt );
320320
}
321321
else if ( QgsLineString *lineString = qgsgeometry_cast<QgsLineString *>( mGeometry.constGet() ) )

0 commit comments

Comments
 (0)