Skip to content

Commit 8769abe

Browse files
committed
Fix precision of coordinate display for layer in non-projected CRS
1 parent 31c788d commit 8769abe

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/core/qgscoordinateutils.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ int QgsCoordinateUtils::calculateCoordinatePrecision( double mapUnitsPerPixel, c
3232
QString format = QgsProject::instance()->readEntry( "PositionPrecision", "/DegreeFormat", "MU" );
3333
bool formatGeographic = ( format == "DM" || format == "DMS" || format == "D" );
3434

35-
// we can only calculate an automatic precision if both map CRS and format are geographic or both not geographic
36-
if ( mapCrs.geographicFlag() == formatGeographic )
35+
// we can only calculate an automatic precision if one of these is true:
36+
// - both map CRS and format are geographic
37+
// - both map CRS and format are not geographic
38+
// - map CRS is geographic but format is not geographic (i.e. map units)
39+
if ( mapCrs.geographicFlag() || !formatGeographic )
3740
{
3841
// Work out a suitable number of decimal places for the coordinates with the aim of always
3942
// having enough decimal places to show the difference in position between adjacent pixels.

0 commit comments

Comments
 (0)