Skip to content

Commit 060af36

Browse files
committed
avoid useless canvas redraw when user interacts with scale selector
1 parent 2d8b1ab commit 060af36

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/app/qgisapp.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -4444,6 +4444,8 @@ void QgisApp::showScale( double theScale )
44444444
else
44454445
mScaleEdit->setEditText( tr( "Invalid scale" ) );
44464446

4447+
mOldScale = mScaleEdit->currentText();
4448+
44474449
if ( mScaleEdit->width() > mScaleEdit->minimumWidth() )
44484450
{
44494451
mScaleEdit->setMinimumWidth( mScaleEdit->width() );
@@ -4452,6 +4454,11 @@ void QgisApp::showScale( double theScale )
44524454

44534455
void QgisApp::userScale()
44544456
{
4457+
if ( mOldScale == mScaleEdit->currentText() )
4458+
{
4459+
return;
4460+
}
4461+
44554462
QStringList parts = mScaleEdit->currentText().split( ':' );
44564463
if ( parts.size() == 2 )
44574464
{

src/app/qgisapp.h

+2
Original file line numberDiff line numberDiff line change
@@ -1150,6 +1150,8 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
11501150
void projectChanged( const QDomDocument & );
11511151

11521152
bool cmpByText( QAction* a, QAction* b );
1153+
1154+
QString mOldScale;
11531155
};
11541156

11551157
#ifdef ANDROID

0 commit comments

Comments
 (0)