Skip to content

Commit

Permalink
fix digitizing with curve #39590
Browse files Browse the repository at this point in the history
  • Loading branch information
vcloarec authored and nyalldawson committed Oct 25, 2020
1 parent ae565f1 commit c03c441
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gui/qgsmaptoolcapture.cpp
Expand Up @@ -594,10 +594,12 @@ int QgsMapToolCapture::addVertex( const QgsPointXY &point, const QgsPointLocator
mSnappingMatches.append( match );
}
}
mCaptureLastPoint = mapPoint;
mTempRubberBand->reset( mCaptureMode == CapturePolygon ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, mDigitizingType, firstCapturedMapPoint() );
}
else if ( mCaptureCurve.numPoints() == 0 )
{
mCaptureLastPoint = mapPoint;
mCaptureCurve.addVertex( layerPoint );
mSnappingMatches.append( match );
}
Expand All @@ -610,7 +612,6 @@ int QgsMapToolCapture::addVertex( const QgsPointXY &point, const QgsPointLocator
}

mTempRubberBand->addPoint( mapPoint );
mCaptureLastPoint = mapPoint;
}
else
{
Expand Down
3 changes: 3 additions & 0 deletions tests/src/app/testqgsmaptooladdfeatureline.cpp
Expand Up @@ -294,8 +294,11 @@ void TestQgsMapToolAddFeatureLine::testNoTracing()
QCOMPARE( utils.existingFeatureIds().count(), 1 );

utils.mouseClick( 1, 1, Qt::LeftButton );
utils.mouseMove( 5, 5 );
utils.mouseClick( 3, 2, Qt::LeftButton );
utils.mouseMove( 5, 5 );
utils.mouseClick( 4, 2, Qt::LeftButton );
utils.mouseMove( 5, 5 );
utils.mouseClick( 4, 2, Qt::RightButton );

newFid = utils.newFeatureId( oldFids );
Expand Down

0 comments on commit c03c441

Please sign in to comment.