Skip to content

Commit

Permalink
Only add Z and M point values passed onto the model when the geometry…
Browse files Browse the repository at this point in the history
… type requires it
  • Loading branch information
nirvn committed Jun 18, 2024
1 parent c950535 commit 67d54a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/vertexmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,14 +704,14 @@ void VertexModel::setCurrentPoint( const QgsPoint &point )

addToHistory( mMode == AddVertex ? VertexAddition : VertexMove );

vertex.point = point;
vertex.point = QgsPoint( point.x(), point.y() );
if ( QgsWkbTypes::hasZ( mGeometryWkbType ) )
{
vertex.point.addZValue();
vertex.point.addZValue( QgsWkbTypes::hasZ( point.wkbType() ) ? point.z() : 0 );
}
if ( QgsWkbTypes::hasM( mGeometryWkbType ) )
{
vertex.point.addMValue();
vertex.point.addMValue( QgsWkbTypes::hasM( point.wkbType() ) ? point.m() : 0 );
}

if ( mMode == AddVertex )
Expand Down

1 comment on commit 67d54a2

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.