@@ -137,6 +137,7 @@ void QgsMapToolNodeTool::createMovingRubberBands()
137
137
vertexMap[vertex]->setRubberBandValues ( true , lastRubberBand, index );
138
138
index++;
139
139
}
140
+ rb->show ();
140
141
mRubberBands .append ( rb );
141
142
lastRubberBand++;
142
143
}
@@ -475,7 +476,6 @@ void QgsMapToolNodeTool::canvasPressEvent( QMouseEvent * e )
475
476
mSelectedFeature ->deselectAllVertexes ();
476
477
}
477
478
}
478
-
479
479
}
480
480
}
481
481
@@ -534,61 +534,58 @@ void QgsMapToolNodeTool::canvasReleaseEvent( QMouseEvent * e )
534
534
mSelectAnother = false ;
535
535
}
536
536
}
537
- else
537
+ else if ( mMoving )
538
538
{
539
- if ( mMoving )
540
- {
541
- mMoving = false ;
542
- QgsPoint releaseMapCoords, pressMapCoords;
539
+ mMoving = false ;
540
+ QgsPoint releaseMapCoords, pressMapCoords;
543
541
544
- QgsExcludePointFilter excludePointFilter ( mClosestMapVertex );
545
- QgsPointLocator::Match match = mCanvas ->snappingUtils ()->snapToMap ( e->pos (), &excludePointFilter );
542
+ QgsExcludePointFilter excludePointFilter ( mClosestMapVertex );
543
+ QgsPointLocator::Match match = mCanvas ->snappingUtils ()->snapToMap ( e->pos (), &excludePointFilter );
546
544
547
- if ( match.isValid () )
548
- {
549
- releaseMapCoords = match.point ();
550
- pressMapCoords = mClosestMapVertex ;
551
- }
552
- else
553
- {
554
- releaseMapCoords = toMapCoordinates ( e->pos () );
555
- pressMapCoords = toMapCoordinates ( mPressCoordinates );
556
- }
545
+ if ( match.isValid () )
546
+ {
547
+ releaseMapCoords = match.point ();
548
+ pressMapCoords = mClosestMapVertex ;
549
+ }
550
+ else
551
+ {
552
+ releaseMapCoords = toMapCoordinates ( e->pos () );
553
+ pressMapCoords = toMapCoordinates ( mPressCoordinates );
554
+ }
557
555
558
- QgsPoint releaseLayerCoords = toLayerCoordinates ( vlayer, releaseMapCoords );
559
- QgsPoint pressLayerCoords = toLayerCoordinates ( vlayer, pressMapCoords );
556
+ QgsPoint releaseLayerCoords = toLayerCoordinates ( vlayer, releaseMapCoords );
557
+ QgsPoint pressLayerCoords = toLayerCoordinates ( vlayer, pressMapCoords );
560
558
561
- if ( match.isValid () )
559
+ if ( match.isValid () )
560
+ {
561
+ int topologicalEditing = QgsProject::instance ()->readNumEntry ( " Digitizing" , " /TopologicalEditing" , 0 );
562
+ if ( topologicalEditing )
562
563
{
563
- int topologicalEditing = QgsProject::instance ()->readNumEntry ( " Digitizing" , " /TopologicalEditing" , 0 );
564
- if ( topologicalEditing )
565
- {
566
- addTopologicalPoints ( QList<QgsPoint>() << releaseMapCoords );
567
- }
564
+ addTopologicalPoints ( QList<QgsPoint>() << releaseMapCoords );
568
565
}
569
-
570
- mSelectedFeature ->moveSelectedVertexes ( releaseLayerCoords - pressLayerCoords );
571
- mCanvas ->refresh ();
572
566
}
573
- else // selecting vertexes by rubberband
574
- {
575
- // coordinates has to be coordinates from layer not canvas
576
- QgsRectangle r ( toLayerCoordinates ( vlayer, mPressCoordinates ),
577
- toLayerCoordinates ( vlayer, e->pos () ) );
578
567
579
- QList<QgsVertexEntry*> &vertexMap = mSelectedFeature ->vertexMap ();
580
- if ( !mCtrl )
581
- {
582
- mSelectedFeature ->deselectAllVertexes ();
583
- }
568
+ mSelectedFeature ->moveSelectedVertexes ( releaseLayerCoords - pressLayerCoords );
569
+ mCanvas ->refresh ();
570
+ }
571
+ else // selecting vertexes by rubberband
572
+ {
573
+ // coordinates has to be coordinates from layer not canvas
574
+ QgsRectangle r ( toLayerCoordinates ( vlayer, mPressCoordinates ),
575
+ toLayerCoordinates ( vlayer, e->pos () ) );
584
576
585
- for ( int i = 0 ; i < vertexMap.size (); i++ )
577
+ QList<QgsVertexEntry*> &vertexMap = mSelectedFeature ->vertexMap ();
578
+ if ( !mCtrl )
579
+ {
580
+ mSelectedFeature ->deselectAllVertexes ();
581
+ }
582
+
583
+ for ( int i = 0 ; i < vertexMap.size (); i++ )
584
+ {
585
+ if ( r.contains ( vertexMap[i]->point () ) )
586
586
{
587
- if ( r.contains ( vertexMap[i]->point () ) )
588
- {
589
- // inverting selection is enough because all were deselected if ctrl is not pressed
590
- mSelectedFeature ->invertVertexSelection ( i, false );
591
- }
587
+ // inverting selection is enough because all were deselected if ctrl is not pressed
588
+ mSelectedFeature ->invertVertexSelection ( i, false );
592
589
}
593
590
}
594
591
}
0 commit comments