summaryrefslogtreecommitdiff
path: root/src/mbgl/text/placement.cpp
diff options
context:
space:
mode:
authorAnsis Brammanis <ansis@mapbox.com>2017-11-10 11:32:37 -0500
committerChris Loer <chris.loer@mapbox.com>2017-11-17 10:05:15 -0800
commit22c07596a0c1e2cca12df730be4448bbe79be13d (patch)
tree6f50cda446e03660c6e34aae4122177cffd73fe9 /src/mbgl/text/placement.cpp
parent5bdee52e5c441e6daaae7cf9f320257d0ea3d031 (diff)
downloadqtlocation-mapboxgl-22c07596a0c1e2cca12df730be4448bbe79be13d.tar.gz
[core] Split MapMode::Still into Static and Tile
`Tile` makes sure the symbols in the resulting tile are tileable while symbols in `Still` match rendering in `Continuous` mode.
Diffstat (limited to 'src/mbgl/text/placement.cpp')
-rw-r--r--src/mbgl/text/placement.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mbgl/text/placement.cpp b/src/mbgl/text/placement.cpp
index 1503db1d83..84753c6ea9 100644
--- a/src/mbgl/text/placement.cpp
+++ b/src/mbgl/text/placement.cpp
@@ -154,7 +154,9 @@ bool Placement::commit(const Placement& prevPlacement, TimePoint now) {
bool placementChanged = false;
- float increment = mapMode == MapMode::Still ? 1.0 : std::chrono::duration<float>(commitTime - prevPlacement.commitTime) / Duration(std::chrono::milliseconds(300));
+ float increment = mapMode == MapMode::Continuous ?
+ std::chrono::duration<float>(commitTime - prevPlacement.commitTime) / Duration(std::chrono::milliseconds(300)) :
+ 1.0;
// add the opacities from the current placement, and copy their current values from the previous placement
for (auto& placementPair : placements) {
@@ -275,10 +277,11 @@ JointOpacityState Placement::getOpacity(uint32_t crossTileSymbolID) const {
}
float Placement::symbolFadeChange(TimePoint now) const {
- if (mapMode == MapMode::Still) {
+ if (mapMode == MapMode::Continuous) {
+ return std::chrono::duration<float>(now - commitTime) / Duration(std::chrono::milliseconds(300));
+ } else {
return 1.0;
}
- return std::chrono::duration<float>(now - commitTime) / Duration(std::chrono::milliseconds(300));
}
bool Placement::hasTransitions(TimePoint now) const {