summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llmr/map/map.hpp4
-rw-r--r--include/llmr/map/transform.hpp6
-rw-r--r--src/map/map.cpp4
-rw-r--r--src/map/transform.cpp6
4 files changed, 10 insertions, 10 deletions
diff --git a/include/llmr/map/map.hpp b/include/llmr/map/map.hpp
index abcaa159dd..e20803b99e 100644
--- a/include/llmr/map/map.hpp
+++ b/include/llmr/map/map.hpp
@@ -81,8 +81,8 @@ public:
void resetZoom();
void startScaling();
void stopScaling();
- double getMinZoom();
- double getMaxZoom();
+ double getMinZoom() const;
+ double getMaxZoom() const;
// Rotation
void rotateBy(double sx, double sy, double ex, double ey, double duration = 0);
diff --git a/include/llmr/map/transform.hpp b/include/llmr/map/transform.hpp
index 6ab3d4b841..31e6f2fc63 100644
--- a/include/llmr/map/transform.hpp
+++ b/include/llmr/map/transform.hpp
@@ -39,8 +39,8 @@ public:
double getScale() const;
void startScaling();
void stopScaling();
- double getMinZoom();
- double getMaxZoom();
+ double getMinZoom() const;
+ double getMaxZoom() const;
// Angle
void rotateBy(double sx, double sy, double ex, double ey, time duration = 0);
@@ -71,7 +71,7 @@ private:
void _clearRotating();
void _clearScaling();
- void constrain(double& scale, double& y);
+ void constrain(double& scale, double& y) const;
private:
mutable uv::rwlock mtx;
diff --git a/src/map/map.cpp b/src/map/map.cpp
index 252c46fe5b..af8876541f 100644
--- a/src/map/map.cpp
+++ b/src/map/map.cpp
@@ -314,11 +314,11 @@ void Map::stopScaling() {
update();
}
-double Map::getMinZoom() {
+double Map::getMinZoom() const {
return transform.getMinZoom();
}
-double Map::getMaxZoom() {
+double Map::getMaxZoom() const {
return transform.getMaxZoom();
}
diff --git a/src/map/transform.cpp b/src/map/transform.cpp
index d567a586c9..1eb0a84c3d 100644
--- a/src/map/transform.cpp
+++ b/src/map/transform.cpp
@@ -206,7 +206,7 @@ void Transform::stopScaling() {
_clearScaling();
}
-double Transform::getMinZoom() {
+double Transform::getMinZoom() const {
double test_scale = current.scale;
double test_y = current.y;
constrain(test_scale, test_y);
@@ -214,7 +214,7 @@ double Transform::getMinZoom() {
return std::log2(std::fmin(min_scale, test_scale));
}
-double Transform::getMaxZoom() {
+double Transform::getMaxZoom() const {
return std::log2(max_scale);
}
@@ -299,7 +299,7 @@ void Transform::_setScaleXY(const double new_scale, const double xn, const doubl
#pragma mark - Constraints
-void Transform::constrain(double& scale, double& y) {
+void Transform::constrain(double& scale, double& y) const {
// Constrain minimum zoom to avoid zooming out far enough to show off-world areas.
if (scale < (current.height / util::tileSize)) scale = (current.height / util::tileSize);