Unify default transition values in MapData
Relevant changes: - Added 'defaultFadeDuration' and 'defaultTransitionDelay' to MapData; - Painter & StyleParser now receives a reference to MapData; - As previously seen on the code: 300ms is the default fade duration and 0ms is the default transition duration; - We no longer pass the current time point to Style, since it now uses MapData.animationTime, which gets updated in MapContext::update(). - Updated StyleParser check to use a mock MapData;
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <mbgl/map/source.hpp>
|
||||
#include <mbgl/map/tile.hpp>
|
||||
#include <mbgl/map/map_context.hpp>
|
||||
#include <mbgl/map/map_data.hpp>
|
||||
|
||||
#include <mbgl/platform/log.hpp>
|
||||
#include <mbgl/gl/debugging.hpp>
|
||||
@@ -41,14 +42,14 @@
|
||||
|
||||
using namespace mbgl;
|
||||
|
||||
Painter::Painter(const float pixelRatio_) : pixelRatio(pixelRatio_) {
|
||||
Painter::Painter(MapData& data_) : data(data_) {
|
||||
}
|
||||
|
||||
Painter::~Painter() {
|
||||
}
|
||||
|
||||
bool Painter::needsAnimation() const {
|
||||
return frameHistory.needsAnimation(std::chrono::milliseconds(300));
|
||||
return frameHistory.needsAnimation(data.getDefaultFadeDuration()) || state.isChanging();
|
||||
}
|
||||
|
||||
void Painter::setup() {
|
||||
|
||||
Reference in New Issue
Block a user