Skip to content
Permalink
Browse files

avoid useless canvas redraw when user interacts with scale selector

  • Loading branch information
alexbruy committed Jan 21, 2012
1 parent 2d8b1ab commit 060af367d6781c6885e5cf2bc1dd6aad390d9de7
Showing with 9 additions and 0 deletions.
  1. +7 −0 src/app/qgisapp.cpp
  2. +2 −0 src/app/qgisapp.h
@@ -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() );
@@ -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 )
{
@@ -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

0 comments on commit 060af36

Please sign in to comment.
You can’t perform that action at this time.