Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
#877 - Adding MapChangeRegionIsChanging notifications to remainder of…
Browse files Browse the repository at this point in the history
… methods that also send MapChangeRegion notifications
  • Loading branch information
bleege committed Feb 19, 2015
1 parent 4bd119c commit 7740ce8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mbgl/map/transform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ bool Transform::resize(const uint16_t w, const uint16_t h, const float ratio,

view.notifyMapChange(MapChangeRegionWillChange);

view.notifyMapChange(MapChangeRegionIsChanging);
current.width = final.width = w;
current.height = final.height = h;
current.pixelRatio = final.pixelRatio = ratio;
Expand Down Expand Up @@ -62,6 +63,7 @@ void Transform::_moveBy(const double dx, const double dy, const std::chrono::ste

constrain(final.scale, final.y);

view.notifyMapChange(MapChangeRegionIsChanging);
if (duration == std::chrono::steady_clock::duration::zero()) {
current.x = final.x;
current.y = final.y;
Expand All @@ -73,7 +75,6 @@ void Transform::_moveBy(const double dx, const double dy, const std::chrono::ste
transitions.emplace_front(
std::make_shared<util::ease_transition<double>>(current.y, final.y, current.y, start, duration));
}
view.notifyMapChange(MapChangeRegionIsChanging);

view.notifyMapChange(duration != std::chrono::steady_clock::duration::zero() ?
MapChangeRegionDidChangeAnimated :
Expand Down Expand Up @@ -265,6 +266,7 @@ void Transform::_setScaleXY(const double new_scale, const double xn, const doubl

constrain(final.scale, final.y);

view.notifyMapChange(MapChangeRegionIsChanging);
if (duration == std::chrono::steady_clock::duration::zero()) {
current.scale = final.scale;
current.x = final.x;
Expand Down Expand Up @@ -374,6 +376,7 @@ void Transform::_setAngle(double new_angle, const std::chrono::steady_clock::dur

final.angle = new_angle;

view.notifyMapChange(MapChangeRegionIsChanging);
if (duration == std::chrono::steady_clock::duration::zero()) {
current.angle = final.angle;
} else {
Expand Down

0 comments on commit 7740ce8

Please sign in to comment.