Skip to content

Commit

Permalink
test rounding change
Browse files Browse the repository at this point in the history
(cherry picked from commit e57e174)
  • Loading branch information
roya0045 authored and nyalldawson committed Jan 12, 2021
1 parent b55f20e commit 7e18d92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/qgsmaptoolscalefeature.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/src/app/testqgsmaptoolscalefeature.cpp
Expand Up @@ -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();
}
Expand Down

0 comments on commit 7e18d92

Please sign in to comment.