Skip to content
Permalink
Browse files

Merge pull request #9695 from 3nids/vertextool_sync_fix

[vertex tool] fixes some editor-tool synchronization issues
  • Loading branch information
3nids committed Apr 4, 2019
2 parents 7de6eeb + 5667b74 commit 4d566a34b3f32e5182eb67aa83aa6c192f44101d
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 4d566a3

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