Skip to content

Commit

Permalink
Fix wrong index point addition in polygon geometries
Browse files Browse the repository at this point in the history
  • Loading branch information
Withalion authored and nyalldawson committed Feb 26, 2025
1 parent 3b9eb96 commit 54607d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/3d/qgsrubberband3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ void QgsRubberBand3D::addPoint( const QgsPoint &pt )
if ( QgsPolygon *polygon = qgsgeometry_cast<QgsPolygon *>( mGeometry.constGet() ) )
{
QgsLineString *exteriorRing = qgsgeometry_cast<QgsLineString *>( polygon->exteriorRing() );
const int lastVertexIndex = exteriorRing->numPoints() - 2;
const int lastVertexIndex = exteriorRing->numPoints() - 1;
exteriorRing->insertVertex( QgsVertexId( 0, 0, lastVertexIndex ), pt );
}
else if ( QgsLineString *lineString = qgsgeometry_cast<QgsLineString *>( mGeometry.constGet() ) )
Expand Down

0 comments on commit 54607d3

Please sign in to comment.