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 068493d commit ddb51fe
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 @@ -4348,6 +4348,8 @@ void QgisApp::showScale( double theScale )
else
mScaleEdit->setText( tr( "Invalid scale" ) );

mOldScale = mScaleEdit->text();

// Set minimum necessary width
if ( mScaleEdit->width() > mScaleEdit->minimumWidth() )
{
Expand All @@ -4357,6 +4359,11 @@ void QgisApp::showScale( double theScale )

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

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

//! project changed
void projectChanged( const QDomDocument & );

QString mOldScale;
};

#endif

0 comments on commit ddb51fe

Please sign in to comment.