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:
@@ -254,21 +254,15 @@ void MapContext::update() {
|
||||
return;
|
||||
}
|
||||
|
||||
const TimePoint now = Clock::now();
|
||||
|
||||
data.setAnimationTime(now);
|
||||
|
||||
if (updated & static_cast<UpdateType>(Update::DefaultTransitionDuration)) {
|
||||
style->setDefaultTransitionDuration(data.getDefaultTransitionDuration());
|
||||
}
|
||||
data.setAnimationTime(Clock::now());
|
||||
|
||||
if (updated & static_cast<UpdateType>(Update::Classes)) {
|
||||
style->cascade(data.getClasses(), now);
|
||||
style->cascade();
|
||||
}
|
||||
|
||||
if (updated & static_cast<UpdateType>(Update::Classes) ||
|
||||
updated & static_cast<UpdateType>(Update::Zoom)) {
|
||||
style->recalculate(transformState.getNormalizedZoom(), now);
|
||||
style->recalculate(transformState.getNormalizedZoom());
|
||||
}
|
||||
|
||||
style->update(transformState, *texturePool);
|
||||
@@ -330,7 +324,7 @@ MapContext::RenderResult MapContext::renderSync(const TransformState& state, con
|
||||
glObjectStore.performCleanup();
|
||||
|
||||
if (!painter) {
|
||||
painter = std::make_unique<Painter>(data.pixelRatio);
|
||||
painter = std::make_unique<Painter>(data);
|
||||
painter->setup();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user