File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -108,14 +108,22 @@ void QgsMapToolCapture::canvasMoveEvent( QMouseEvent * e )
108
108
QList<QgsSnappingResult> snapResults;
109
109
if ( mSnapper .snapToBackgroundLayers ( e->pos (), snapResults ) == 0 )
110
110
{
111
- delete mSnappingMarker ;
112
-
113
- mSnappingMarker = new QgsVertexMarker ( mCanvas );
114
- mSnappingMarker ->setIconType ( QgsVertexMarker::ICON_CROSS );
115
- mSnappingMarker ->setColor ( Qt::magenta );
116
- mSnappingMarker ->setPenWidth ( 3 );
117
- mSnappingMarker ->setCenter ( snapPointFromResults ( snapResults, e->pos () ) );
118
-
111
+ if ( snapResults.isEmpty () )
112
+ {
113
+ delete mSnappingMarker ;
114
+ mSnappingMarker = 0 ;
115
+ }
116
+ else
117
+ {
118
+ if ( !mSnappingMarker )
119
+ {
120
+ mSnappingMarker = new QgsVertexMarker ( mCanvas );
121
+ mSnappingMarker ->setIconType ( QgsVertexMarker::ICON_CROSS );
122
+ mSnappingMarker ->setColor ( Qt::magenta );
123
+ mSnappingMarker ->setPenWidth ( 3 );
124
+ }
125
+ mSnappingMarker ->setCenter ( snapResults.constBegin ()->snappedVertex );
126
+ }
119
127
120
128
if ( mCaptureMode != CapturePoint && mTempRubberBand && mCapturing )
121
129
{
You can’t perform that action at this time.
0 commit comments