Skip to content
Permalink
Browse files

Ensure pan distance display in status bar uses project distance units

  • Loading branch information
nyalldawson committed Jan 9, 2020
1 parent 9fd3681 commit fc555ca69a01fafe544523a405e15e88e12ae8fe
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/app/qgisapp.cpp
@@ -12920,8 +12920,11 @@ void QgisApp::showRotation()

void QgisApp::showPanMessage( double distance, QgsUnitTypes::DistanceUnit unit, double bearing )
{
mStatusBar->showMessage( tr( "Pan distance %1 (%2)" ).arg( QgsDistanceArea::formatDistance( distance, 1, unit ),
mBearingNumericFormat->formatDouble( bearing, QgsNumericFormatContext() ) ), 2000 );
const double distanceInProjectUnits = distance * QgsUnitTypes::fromUnitToUnitFactor( unit, QgsProject::instance()->distanceUnits() );
const int distanceDecimalPlaces = QgsSettings().value( QStringLiteral( "qgis/measure/decimalplaces" ), "3" ).toInt();
const QString distanceString = QgsDistanceArea::formatDistance( distanceInProjectUnits, distanceDecimalPlaces, QgsProject::instance()->distanceUnits() );
const QString bearingString = mBearingNumericFormat->formatDouble( bearing, QgsNumericFormatContext() );
mStatusBar->showMessage( tr( "Pan distance %1 (%2)" ).arg( distanceString, bearingString ), 2000 );
}

void QgisApp::selectionModeChanged( QgsMapToolSelect::Mode mode )

0 comments on commit fc555ca

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