Skip to content
Permalink
Browse files

Merge pull request #9706 from qgis/backport-9695-to-release-3_4

[Backport release-3_4] [vertex tool] fixes some editor-tool synchronization issues
  • Loading branch information
3nids committed Apr 4, 2019
2 parents 0705fee + 6a7b424 commit f34802be9069c37c615178f54be2d8df0d841df8
Showing with 15 additions and 11 deletions.
  1. +0 −9 src/app/vertextool/qgslockedfeature.cpp
  2. +15 −2 src/app/vertextool/qgsvertextool.cpp
@@ -42,15 +42,6 @@ QgsLockedFeature::QgsLockedFeature( QgsFeatureId featureId,
// signal changing of current layer
connect( QgisApp::instance()->layerTreeView(), &QgsLayerTreeView::currentLayerChanged, this, &QgsLockedFeature::currentLayerChanged );

// feature was deleted
connect( mLayer, &QgsVectorLayer::featureDeleted, this, &QgsLockedFeature::featureDeleted );

// rolling back
connect( mLayer, &QgsVectorLayer::beforeRollBack, this, &QgsLockedFeature::beforeRollBack );

// geometry was changed
connect( mLayer, &QgsVectorLayer::geometryChanged, this, &QgsLockedFeature::geometryChanged );

replaceVertexMap();
}

@@ -1304,8 +1304,13 @@ void QgsVertexTool::onCachedGeometryChanged( QgsFeatureId fid, const QgsGeometry
// re-run validation for the feature
validateGeometry( layer, fid );

if ( mVertexEditor && mLockedFeature && mLockedFeature->featureId() == fid && mLockedFeature->layer() == layer )
mVertexEditor->updateEditor( mLockedFeature.get() );
if ( mLockedFeature && mLockedFeature->featureId() == fid && mLockedFeature->layer() == layer )
{
mLockedFeature->geometryChanged( fid, geom );
if ( mVertexEditor )
mVertexEditor->updateEditor( mLockedFeature.get() );
updateLockedFeatureVertices();
}
}

void QgsVertexTool::onCachedGeometryDeleted( QgsFeatureId fid )
@@ -1318,6 +1323,12 @@ void QgsVertexTool::onCachedGeometryDeleted( QgsFeatureId fid )

// refresh highlighted vertices - some may have been deleted
setHighlightedVertices( mSelectedVertices );

if ( mLockedFeature && mLockedFeature->featureId() == fid && mLockedFeature->layer() == layer )
{
mLockedFeature->featureDeleted( fid );
updateLockedFeatureVertices();
}
}

void QgsVertexTool::updateVertexEditor( QgsVectorLayer *layer, QgsFeatureId fid )
@@ -1401,6 +1412,7 @@ void QgsVertexTool::cleanupVertexEditor()
{
mLockedFeature.reset();
mVertexEditor.reset();
updateLockedFeatureVertices();
}

void QgsVertexTool::cleanupLockedFeature()
@@ -2022,6 +2034,7 @@ void QgsVertexTool::moveVertex( const QgsPointXY &mapPoint, const QgsPointLocato
}
}

updateLockedFeatureVertices();
if ( mVertexEditor )
mVertexEditor->updateEditor( mLockedFeature.get() );

0 comments on commit f34802b

Please sign in to comment.
You can’t perform that action at this time.