Skip to content

Commit

Permalink
prevent potential misuse and remove duplicate nodes for some topologi…
Browse files Browse the repository at this point in the history
…cal cases
  • Loading branch information
lbartoletti authored and nyalldawson committed Aug 13, 2019
1 parent cf08114 commit 5077a78
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/app/qgsmaptooltrimextendfeature.cpp
Expand Up @@ -109,14 +109,23 @@ void QgsMapToolTrimExtendFeature::canvasMoveEvent( QgsMapMouseEvent *e )

QgsMapLayer *currentLayer = mCanvas->currentLayer();
if ( !currentLayer )
{
mIsModified = false;
break;
}

mVlayer = qobject_cast<QgsVectorLayer *>( currentLayer );
if ( !mVlayer )
{
mIsModified = false;
break;
}

if ( !mVlayer->isEditable() )
{
mIsModified = false;
break;
}

filter.setLayer( mVlayer );
match = mCanvas->snappingUtils()->snapToMap( mMapPoint, &filter );
Expand Down Expand Up @@ -189,6 +198,7 @@ void QgsMapToolTrimExtendFeature::canvasMoveEvent( QgsMapMouseEvent *e )

if ( mIsModified )
{
mGeom.removeDuplicateNodes();
mRubberBandExtend->setToGeometry( mGeom );
mRubberBandExtend->show();
}
Expand Down

0 comments on commit 5077a78

Please sign in to comment.