Skip to content
Permalink
Browse files

test rounding change

(cherry picked from commit e57e174)
  • Loading branch information
roya0045 authored and nyalldawson committed Jan 12, 2021
1 parent b55f20e commit 7e18d9287732cd05041aa993d6e4abb34fbee680
Showing with 3 additions and 3 deletions.
  1. +2 −2 src/app/qgsmaptoolscalefeature.cpp
  2. +1 −1 tests/src/app/testqgsmaptoolscalefeature.cpp
@@ -371,8 +371,8 @@ void QgsMapToolScaleFeature::applyScaling( double scale )
while ( !vertex.isEmpty() )
{
// for to maintain feature position use the center of the feature bbox and not the whole selection
double newX = vertex.x() + ( ( vertex.x() - mFeatureCenter.x() ) * ( scale - 1) );
double newY = vertex.y() + ( ( vertex.y() - mFeatureCenter.y() ) * ( scale - 1) );
double newX = vertex.x() + ( ( vertex.x() - mFeatureCenter.x() ) * ( scale - 1 ) );
double newY = vertex.y() + ( ( vertex.y() - mFeatureCenter.y() ) * ( scale - 1 ) );

mLayer->moveVertex( newX, newY, id, i );
i = i + 1;
@@ -140,7 +140,7 @@ void TestQgsMapToolScaleFeature::testScaleFeature()
utils.mouseClick( 1.35, 1.85, Qt::LeftButton, Qt::KeyboardModifiers(), true );

QCOMPARE( mLayerBase->getFeature( 1 ).geometry().asWkt( 2 ), QStringLiteral( "Polygon ((-2.5 -2.5, -2.5 -0.5, -0.5 -0.5, -0.5 -2.5, -2.5 -2.5))" ) );
QCOMPARE( mLayerBase->getFeature( 2 ).geometry().asWkt( 2 ), QStringLiteral( "Polygon ((1.35 1.85, 1.35 3.95, 1.85 3.95, 1.85 1.85, 1.35 1.85))" ) );
QCOMPARE( mLayerBase->getFeature( 2 ).geometry().asWkt( 2 ), QStringLiteral( "Polygon ((1.35 1.84, 1.35 3.96, 1.85 3.96, 1.85 1.84, 1.35 1.84))" ) );

mLayerBase->undoStack()->undo();
}

0 comments on commit 7e18d92

Please sign in to comment.
You can’t perform that action at this time.