Skip to content
Permalink
Browse files
Trying to understand what's wrong on travis...
  • Loading branch information
wonder-sk committed Mar 29, 2017
1 parent 8e7bb3b commit f44200e097c5b58588d9948847df101d022ab0bb
Showing with 11 additions and 4 deletions.
  1. +11 −4 src/app/nodetool/qgsnodetool2.cpp
@@ -314,21 +314,25 @@ void QgsNodeTool2::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
}
else // selection rect is not being dragged
{
qDebug( "release: no selection rect!" );
if ( e->button() == Qt::LeftButton )
{
// accepting action
if ( mDraggingVertex )
{
QgsPointLocator::Match match = e->mapPointMatch();
qDebug( "release: move vertex" );
moveVertex( e->mapPoint(), &match );
}
else if ( mDraggingEdge )
{
// do not use e.mapPoint() as it may be snapped
qDebug( "release: move edge" );
moveEdge( toMapCoordinates( e->pos() ) );
}
else
{
qDebug( "release: start dragging" );
startDragging( e );
}
}
@@ -1016,11 +1020,12 @@ void QgsNodeTool2::moveVertex( const QgsPoint &mapPoint, const QgsPointLocator::
stopDragging();

QgsPoint layerPoint = matchToLayerPoint( dragLayer, mapPoint, mapPointMatch );
qDebug( "layer pt: %f,%f", layerPoint.x(), layerPoint.y() );

QgsVertexId vid;
if ( !geom.vertexIdFromVertexNr( dragVertexId, vid ) )
{
QgsDebugMsg( "invalid vertex index" );
qDebug( "invalid vertex index" );
return;
}

@@ -1034,15 +1039,15 @@ void QgsNodeTool2::moveVertex( const QgsPoint &mapPoint, const QgsPointLocator::

if ( !geomTmp->insertVertex( vid, QgsPointV2( layerPoint ) ) )
{
QgsDebugMsg( "append vertex failed!" );
qDebug( "append vertex failed!" );
return;
}
}
else
{
if ( !geomTmp->moveVertex( vid, QgsPointV2( layerPoint ) ) )
{
QgsDebugMsg( "move vertex failed!" );
qDebug( "move vertex failed!" );
return;
}
}
@@ -1070,7 +1075,7 @@ void QgsNodeTool2::moveVertex( const QgsPoint &mapPoint, const QgsPointLocator::

if ( !topoGeom.moveVertex( point.x(), point.y(), topo.vertexId ) )
{
QgsDebugMsg( "[topo] move vertex failed!" );
qDebug( "[topo] move vertex failed!" );
continue;
}
edits[topo.layer][topo.fid] = topoGeom;
@@ -1080,6 +1085,8 @@ void QgsNodeTool2::moveVertex( const QgsPoint &mapPoint, const QgsPointLocator::

// TODO: add topological points: when moving vertex - if snapped to something

qDebug( "writing changes now" );

// do the changes to layers
QHash<QgsVectorLayer*, QHash<QgsFeatureId, QgsGeometry> >::iterator it = edits.begin();
for ( ; it != edits.end(); ++it )

0 comments on commit f44200e

Please sign in to comment.