File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ class TestQgsMapCanvas : public QObject
49
49
void testPanByKeyboard ();
50
50
void testMagnification ();
51
51
void testMagnificationExtent ();
52
+ void testMagnificationScale ();
52
53
53
54
private:
54
55
QgsMapCanvas* mCanvas ;
@@ -344,5 +345,20 @@ void TestQgsMapCanvas::testMagnificationExtent()
344
345
compareExtent ( mCanvas ->extent (), initialExtent );
345
346
}
346
347
348
+ void TestQgsMapCanvas::testMagnificationScale ()
349
+ {
350
+ mCanvas ->setMagnificationFactor ( 1.0 );
351
+ double initialScale = mCanvas ->scale ();
352
+
353
+ mCanvas ->setMagnificationFactor ( 4.0 );
354
+ QCOMPARE ( initialScale, mCanvas ->scale () );
355
+
356
+ mCanvas ->setMagnificationFactor ( 7.5 );
357
+ QCOMPARE ( initialScale, mCanvas ->scale () );
358
+
359
+ mCanvas ->setMagnificationFactor ( 1.0 );
360
+ QCOMPARE ( initialScale, mCanvas ->scale () );
361
+ }
362
+
347
363
QTEST_MAIN ( TestQgsMapCanvas )
348
364
#include " testqgsmapcanvas.moc"
You can’t perform that action at this time.
0 commit comments