make some more getter functions constant

This commit is contained in:
Justin R. Miller
2014-06-01 15:32:03 -07:00
parent 93e8386af4
commit e5a78c931a
4 changed files with 10 additions and 10 deletions

View File

@@ -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);