File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ void QgsScaleComboBox::fixupScale()
157
157
if ( ok && ( newScale != oldScale ) )
158
158
{
159
159
// if a user types scale = 2345, we transform to 1:2345
160
- if ( userSetScale )
160
+ if ( userSetScale && newScale >= 1.0 )
161
161
{
162
162
mScale = 1 / newScale;
163
163
}
Original file line number Diff line number Diff line change @@ -75,12 +75,12 @@ void TestQgsScaleComboBox::basic()
75
75
QCOMPARE ( s->scaleString (), QString ( " 1:50" ) );
76
76
QCOMPARE ( s->scale (), ( double ) 0.02 );
77
77
78
- // Testing conversion from number to "x:1 "
78
+ // Testing conversion from number to "1:x "
79
79
l->setText ( " " );
80
80
QTest::keyClicks ( l, QLocale::system ().toString ( 42 ) );
81
81
QTest::keyClick ( l, Qt::Key_Return );
82
- QCOMPARE ( s->scaleString (), QString ( " 42:1 " ) );
83
- QCOMPARE ( s->scale (), ( double ) 42 );
82
+ QCOMPARE ( s->scaleString (), QString ( " 1:42 " ) );
83
+ QCOMPARE ( s->scale (), ( double ) 1.0 / ( double ) 42.0 );
84
84
85
85
// Testing rounding and conversion from illegal
86
86
You can’t perform that action at this time.
0 commit comments