Skip to content

Commit

Permalink
replace call to asMultiPoint to avoid to use addTopologicalPoints( Qg…
Browse files Browse the repository at this point in the history
…sPointXY ) deprecated method
  • Loading branch information
lbartoletti committed May 17, 2021
1 parent 9cac6d3 commit e226150
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/app/vertextool/qgsvertextool.cpp
Expand Up @@ -2186,10 +2186,9 @@ void QgsVertexTool::moveVertex( const QgsPointXY &mapPoint, const QgsPointLocato
for ( QgsGeometry g : editGeom )
{
QgsGeometry p = QgsGeometry::fromPointXY( QgsPointXY( layerPoint.x(), layerPoint.y() ) );
QgsGeometry pts = g.convertToType( QgsWkbTypes::PointGeometry, true );
if ( ( mapPointMatch->hasEdge() || mapPointMatch->hasMiddleSegment() ) && mapPointMatch->layer() && ( layer->crs() == mapPointMatch->layer()->crs() ) )
{
if ( pts.contains( p ) )
if ( g.convertToType( QgsWkbTypes::PointGeometry, true ).contains( p ) )
{
if ( !layerPoint.is3D() )
layerPoint.addZValue( defaultZValue() );
Expand All @@ -2198,7 +2197,12 @@ void QgsVertexTool::moveVertex( const QgsPointXY &mapPoint, const QgsPointLocato
}
}
if ( QgsProject::instance()->avoidIntersectionsMode() != QgsProject::AvoidIntersectionsMode::AllowIntersections )
QgsMapToolEdit::addTopologicalPoints( pts.asMultiPoint() );
{
for ( QgsAbstractGeometry::vertex_iterator it = g.vertices_begin() ; it != g.vertices_end() ; it++ )
{
layer->addTopologicalPoints( *it );
}
}
}
}
}
Expand Down

0 comments on commit e226150

Please sign in to comment.