@@ -45,17 +45,20 @@ class CORE_EXPORT QgsCoordinateUtils
45
45
public:
46
46
47
47
/* *
48
- * Returns the precision to use for displaying coordinates to the user, respecting
49
- * the user's project settings. If the user has set the project to use "automatic"
50
- * precision, this function tries to calculate an optimal coordinate precision for a given
51
- * map units per pixel by calculating the number of decimal places for the coordinates
52
- * with the aim of always having enough decimal places to show the difference in position
53
- * between adjacent pixels.
54
- * \param mapUnitsPerPixel number of map units per pixel
55
- * \param mapCrs CRS of map
56
- * \returns optimal number of decimal places for coordinates
48
+ * Returns the precision to use for displaying coordinates in \a mapCrs to the user.
49
+ * It respects the user's \a project settings.
50
+ * If the user has set the project to use "automatic" precision, this function tries
51
+ * to calculate an optimal coordinate precision for a given \a mapUnitsPerPixel by
52
+ * calculating the number of decimal places for the coordinates with the aim of always
53
+ * having enough decimal places to show the difference in position between adjacent
54
+ * pixels.
55
+ *
56
+ * \since QGIS 3.6 a new \a project parameter is available. Using the method without this
57
+ * a \a project paramter is deprecated and will be removed with QGIS 4.
58
+ * For backward compatibility, QgsProject.instance() will be used if the \a project
59
+ * parameter is not specified.
57
60
*/
58
- Q_INVOKABLE static int calculateCoordinatePrecision ( double mapUnitsPerPixel, const QgsCoordinateReferenceSystem &mapCrs );
61
+ Q_INVOKABLE static int calculateCoordinatePrecision ( double mapUnitsPerPixel, const QgsCoordinateReferenceSystem &mapCrs, QgsProject *project = nullptr );
59
62
60
63
/* *
61
64
* Formats a \a point coordinate for use with the specified \a project, respecting the project's
0 commit comments