Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
test rounding change
(cherry picked from commit e57e174)
- Loading branch information
|
@@ -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(); |
|
|
} |
|
|
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.