Skip to content

Commit

Permalink
[convert to curve] fix test
Browse files Browse the repository at this point in the history
(change of key and key now cancels dragging vertex)
  • Loading branch information
olivierdalang authored and nyalldawson committed Jun 18, 2021
1 parent b0590e9 commit e205ce8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/src/app/testqgsvertextool.cpp
Expand Up @@ -808,12 +808,10 @@ void TestQgsVertexTool::testConvertVertex()
// convert vertex in compoundCurve while moving vertex
QCOMPARE( mLayerCompoundCurve->getFeature( mFidCompoundCurveF1 ).geometry(), QgsGeometry::fromWkt( "CompoundCurve ( CircularString (14 14, 10 10, 17 10))" ) );
mouseClick( 10, 10, Qt::LeftButton );
keyClick( Qt::Key_C );
mouseClick( 10, 10, Qt::LeftButton );
QCOMPARE( mLayerCompoundCurve->undoStack()->index(), 4 ); // one undo for move, one undo for convert
keyClick( Qt::Key_O );
QCOMPARE( mLayerCompoundCurve->undoStack()->index(), 3 );
QCOMPARE( mLayerCompoundCurve->getFeature( mFidCompoundCurveF1 ).geometry(), QgsGeometry::fromWkt( "CompoundCurve ((14 14, 10 10, 17 10))" ) );
mLayerCompoundCurve->undoStack()->undo();
mLayerCompoundCurve->undoStack()->undo();
QCOMPARE( mLayerCompoundCurve->undoStack()->index(), 2 );
QCOMPARE( mLayerCompoundCurve->getFeature( mFidCompoundCurveF1 ).geometry(), QgsGeometry::fromWkt( "CompoundCurve ( CircularString (14 14, 10 10, 17 10))" ) );

Expand All @@ -822,7 +820,7 @@ void TestQgsVertexTool::testConvertVertex()
mousePress( 9.5, 9.5, Qt::LeftButton );
mouseMove( 10.5, 10.5 );
mouseRelease( 10.5, 10.5, Qt::LeftButton );
keyClick( Qt::Key_C );
keyClick( Qt::Key_O );
QCOMPARE( mLayerCompoundCurve->undoStack()->index(), 3 );
QCOMPARE( mLayerCompoundCurve->getFeature( mFidCompoundCurveF1 ).geometry(), QgsGeometry::fromWkt( "CompoundCurve ((14 14, 10 10, 17 10))" ) );
mLayerCompoundCurve->undoStack()->undo();
Expand Down

0 comments on commit e205ce8

Please sign in to comment.