@@ -314,21 +314,25 @@ void QgsNodeTool2::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
314
314
}
315
315
else // selection rect is not being dragged
316
316
{
317
+ qDebug ( " release: no selection rect!" );
317
318
if ( e->button () == Qt::LeftButton )
318
319
{
319
320
// accepting action
320
321
if ( mDraggingVertex )
321
322
{
322
323
QgsPointLocator::Match match = e->mapPointMatch ();
324
+ qDebug ( " release: move vertex" );
323
325
moveVertex ( e->mapPoint (), &match );
324
326
}
325
327
else if ( mDraggingEdge )
326
328
{
327
329
// do not use e.mapPoint() as it may be snapped
330
+ qDebug ( " release: move edge" );
328
331
moveEdge ( toMapCoordinates ( e->pos () ) );
329
332
}
330
333
else
331
334
{
335
+ qDebug ( " release: start dragging" );
332
336
startDragging ( e );
333
337
}
334
338
}
@@ -1016,11 +1020,12 @@ void QgsNodeTool2::moveVertex( const QgsPoint &mapPoint, const QgsPointLocator::
1016
1020
stopDragging ();
1017
1021
1018
1022
QgsPoint layerPoint = matchToLayerPoint ( dragLayer, mapPoint, mapPointMatch );
1023
+ qDebug ( " layer pt: %f,%f" , layerPoint.x (), layerPoint.y () );
1019
1024
1020
1025
QgsVertexId vid;
1021
1026
if ( !geom.vertexIdFromVertexNr ( dragVertexId, vid ) )
1022
1027
{
1023
- QgsDebugMsg ( " invalid vertex index" );
1028
+ qDebug ( " invalid vertex index" );
1024
1029
return ;
1025
1030
}
1026
1031
@@ -1034,15 +1039,15 @@ void QgsNodeTool2::moveVertex( const QgsPoint &mapPoint, const QgsPointLocator::
1034
1039
1035
1040
if ( !geomTmp->insertVertex ( vid, QgsPointV2 ( layerPoint ) ) )
1036
1041
{
1037
- QgsDebugMsg ( " append vertex failed!" );
1042
+ qDebug ( " append vertex failed!" );
1038
1043
return ;
1039
1044
}
1040
1045
}
1041
1046
else
1042
1047
{
1043
1048
if ( !geomTmp->moveVertex ( vid, QgsPointV2 ( layerPoint ) ) )
1044
1049
{
1045
- QgsDebugMsg ( " move vertex failed!" );
1050
+ qDebug ( " move vertex failed!" );
1046
1051
return ;
1047
1052
}
1048
1053
}
@@ -1070,7 +1075,7 @@ void QgsNodeTool2::moveVertex( const QgsPoint &mapPoint, const QgsPointLocator::
1070
1075
1071
1076
if ( !topoGeom.moveVertex ( point.x (), point.y (), topo.vertexId ) )
1072
1077
{
1073
- QgsDebugMsg ( " [topo] move vertex failed!" );
1078
+ qDebug ( " [topo] move vertex failed!" );
1074
1079
continue ;
1075
1080
}
1076
1081
edits[topo.layer ][topo.fid ] = topoGeom;
@@ -1080,6 +1085,8 @@ void QgsNodeTool2::moveVertex( const QgsPoint &mapPoint, const QgsPointLocator::
1080
1085
1081
1086
// TODO: add topological points: when moving vertex - if snapped to something
1082
1087
1088
+ qDebug ( " writing changes now" );
1089
+
1083
1090
// do the changes to layers
1084
1091
QHash<QgsVectorLayer*, QHash<QgsFeatureId, QgsGeometry> >::iterator it = edits.begin ();
1085
1092
for ( ; it != edits.end (); ++it )
0 commit comments