diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2015-08-03 00:14:07 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2015-08-05 15:19:00 +0300 |
commit | 58357b7964fcc44cbb824da64225fe58bb3d3dd1 (patch) | |
tree | 56dc550de482f2c0b64c984473ff44ea4dc4e66a /src | |
parent | 0eb7effad729aa66cc05067b75d89b4d41ee0024 (diff) | |
download | qtlocation-mapboxgl-58357b7964fcc44cbb824da64225fe58bb3d3dd1.tar.gz |
Removed Transform::needsTransition()
Transform::updateTransitions() already checks if there is a callback to
update transitions.
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/map/map.cpp | 8 | ||||
-rw-r--r-- | src/mbgl/map/transform.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/map/transform.hpp | 1 |
3 files changed, 4 insertions, 9 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index f357c05e88..d2cd7a53b3 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -73,11 +73,11 @@ bool Map::renderSync() { } void Map::nudgeTransitions(bool forceRerender) { - if (transform->needsTransition()) { - update(Update(transform->updateTransitions(Clock::now()))); - } else if (forceRerender) { - update(); + UpdateType update_ = transform->updateTransitions(Clock::now()); + if (forceRerender) { + update_ |= static_cast<UpdateType>(Update::Repaint); } + update(Update(update_)); } void Map::update(Update update_) { diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp index 08cca3db22..29ca54d78b 100644 --- a/src/mbgl/map/transform.cpp +++ b/src/mbgl/map/transform.cpp @@ -377,10 +377,6 @@ void Transform::startTransition(std::function<Update(double)> frame, transitionFinishFn = finish; } -bool Transform::needsTransition() const { - return !!transitionFrameFn; -} - UpdateType Transform::updateTransitions(const TimePoint& now) { return static_cast<UpdateType>(transitionFrameFn ? transitionFrameFn(now) : Update::Nothing); } diff --git a/src/mbgl/map/transform.hpp b/src/mbgl/map/transform.hpp index badb811afb..f4a78bbcb5 100644 --- a/src/mbgl/map/transform.hpp +++ b/src/mbgl/map/transform.hpp @@ -42,7 +42,6 @@ public: double getAngle() const; // Transitions - bool needsTransition() const; UpdateType updateTransitions(const TimePoint& now); void cancelTransitions(); |