summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-05-03 10:13:01 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-05-03 11:20:01 -0700
commit3790caafa3c98706c5cf0618c8aec592b2780bba (patch)
tree8589f558810e2cb42a69f120545811ace58dfe54
parent88093bd708dccb1082bb624a6c27e5aa7688b77a (diff)
downloadqtlocation-mapboxgl-3790caafa3c98706c5cf0618c8aec592b2780bba.tar.gz
[core] Factor timePoint initialization
-rw-r--r--src/mbgl/map/map.cpp4
-rw-r--r--src/mbgl/style/style.cpp4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp
index 9964c5c9f3..4bd370eff3 100644
--- a/src/mbgl/map/map.cpp
+++ b/src/mbgl/map/map.cpp
@@ -227,7 +227,9 @@ void Map::Impl::render(View& view) {
return;
}
- TimePoint timePoint = Clock::now();
+ TimePoint timePoint = mode == MapMode::Continuous
+ ? Clock::now()
+ : Clock::time_point::max();
auto flags = transform.updateTransitions(timePoint);
diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp
index a3c7ce1ad1..7f21d81b0e 100644
--- a/src/mbgl/style/style.cpp
+++ b/src/mbgl/style/style.cpp
@@ -360,7 +360,7 @@ void Style::cascade(const TimePoint& timePoint, MapMode mode) {
const CascadeParameters parameters {
classIDs,
- mode == MapMode::Continuous ? timePoint : Clock::time_point::max(),
+ timePoint,
mode == MapMode::Continuous ? transitionOptions : immediateTransition
};
@@ -382,7 +382,7 @@ void Style::recalculate(float z, const TimePoint& timePoint, MapMode mode) {
const PropertyEvaluationParameters parameters {
z,
- mode == MapMode::Continuous ? timePoint : Clock::time_point::max(),
+ timePoint,
zoomHistory,
mode == MapMode::Continuous ? util::DEFAULT_FADE_DURATION : Duration::zero()
};