Skip to content

Commit

Permalink
avoid useless canvas redraw when user interacts with scale selector
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Jan 21, 2012
1 parent 2d8b1ab commit 060af36
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -4444,6 +4444,8 @@ void QgisApp::showScale( double theScale )
else
mScaleEdit->setEditText( tr( "Invalid scale" ) );

mOldScale = mScaleEdit->currentText();

if ( mScaleEdit->width() > mScaleEdit->minimumWidth() )
{
mScaleEdit->setMinimumWidth( mScaleEdit->width() );
Expand All @@ -4452,6 +4454,11 @@ void QgisApp::showScale( double theScale )

void QgisApp::userScale()
{
if ( mOldScale == mScaleEdit->currentText() )
{
return;
}

QStringList parts = mScaleEdit->currentText().split( ':' );
if ( parts.size() == 2 )
{
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgisapp.h
Expand Up @@ -1150,6 +1150,8 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
void projectChanged( const QDomDocument & );

bool cmpByText( QAction* a, QAction* b );

QString mOldScale;
};

#ifdef ANDROID
Expand Down

0 comments on commit 060af36

Please sign in to comment.