Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Trying to understand what's wrong on travis...
  • Loading branch information
wonder-sk committed Mar 29, 2017
1 parent 8e7bb3b commit f44200e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/app/nodetool/qgsnodetool2.cpp
Expand Up @@ -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 );
}
}
Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
}
}
Expand Down Expand Up @@ -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;
Expand All @@ -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 )
Expand Down

0 comments on commit f44200e

Please sign in to comment.