summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin R. Miller <incanus@codesorcery.net>2014-07-03 19:02:46 -0700
committerJustin R. Miller <incanus@codesorcery.net>2014-07-03 19:02:46 -0700
commite5d9a20c7c3282a7b058ef40c2ade3429f04f99d (patch)
treeca9826875e63dbd3f90421ada3d4146fe2678a8e /src
parent97d8e73f2facf9a2f00bbcfc242a1999dbe2a689 (diff)
downloadqtlocation-mapboxgl-e5d9a20c7c3282a7b058ef40c2ade3429f04f99d.tar.gz
native-side map change notifications
Diffstat (limited to 'src')
-rw-r--r--src/map/transform.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/map/transform.cpp b/src/map/transform.cpp
index c7bbbfdf7d..72449956d0 100644
--- a/src/map/transform.cpp
+++ b/src/map/transform.cpp
@@ -28,6 +28,8 @@ bool Transform::resize(const uint16_t w, const uint16_t h, const float ratio,
if (final.width != w || final.height != h || final.pixelRatio != ratio ||
final.framebuffer[0] != fb_w || final.framebuffer[1] != fb_h) {
+ platform::notify_map_change(platform::MapChangeRegionWillChange);
+
current.width = final.width = w;
current.height = final.height = h;
current.pixelRatio = final.pixelRatio = ratio;
@@ -35,7 +37,9 @@ bool Transform::resize(const uint16_t w, const uint16_t h, const float ratio,
current.framebuffer[1] = final.framebuffer[1] = fb_h;
if (!canRotate() && current.angle) _setAngle(0);
constrain(current.scale, current.y);
- platform::notify_map_change();
+
+ platform::notify_map_change(platform::MapChangeRegionDidChange);
+
return true;
} else {
return false;
@@ -76,7 +80,9 @@ void Transform::_moveBy(const double dx, const double dy, const timestamp durati
std::make_shared<util::ease_transition<double>>(current.y, final.y, current.y, start, duration));
}
- platform::notify_map_change();
+ platform::notify_map_change(duration ?
+ platform::MapChangeRegionDidChangeAnimated :
+ platform::MapChangeRegionDidChange);
}
void Transform::setLonLat(const double lon, const double lat, const timestamp duration) {
@@ -294,7 +300,9 @@ void Transform::_setScaleXY(const double new_scale, const double xn, const doubl
Bc = s / 360;
Cc = s / (2 * M_PI);
- platform::notify_map_change();
+ platform::notify_map_change(duration ?
+ platform::MapChangeRegionDidChangeAnimated :
+ platform::MapChangeRegionDidChange);
}
#pragma mark - Constraints
@@ -388,7 +396,9 @@ void Transform::_setAngle(double new_angle, const timestamp duration) {
current.angle, final.angle, current.angle, start, duration));
}
- platform::notify_map_change();
+ platform::notify_map_change(duration ?
+ platform::MapChangeRegionDidChangeAnimated :
+ platform::MapChangeRegionDidChange);
}
double Transform::getAngle() const {