summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnsis Brammanis <ansis@mapbox.com>2017-10-25 17:24:49 -0400
committerChris Loer <chris.loer@mapbox.com>2017-10-25 15:07:10 -0700
commit253847cd21519e445aa51c8bb16540065cbe07eb (patch)
treecc49ac69ab4ba685735714fd709938ed0e3812f7
parent26a3776c9e97a510dbb9f30a14167e1c21bb2089 (diff)
downloadqtlocation-mapboxgl-253847cd21519e445aa51c8bb16540065cbe07eb.tar.gz
fix incorrectly hidden symbols
-rw-r--r--src/mbgl/text/placement.cpp10
-rw-r--r--src/mbgl/text/placement.hpp3
2 files changed, 11 insertions, 2 deletions
diff --git a/src/mbgl/text/placement.cpp b/src/mbgl/text/placement.cpp
index 9379d0072f..b89c484b80 100644
--- a/src/mbgl/text/placement.cpp
+++ b/src/mbgl/text/placement.cpp
@@ -27,10 +27,13 @@ JointOpacityState::JointOpacityState(JointOpacityState& prevOpacityState, float
text(OpacityState(prevOpacityState.text, increment, textOpacity)) {}
+uint32_t Placement::maxCrossTileID = 0;
+
Placement::Placement(const TransformState& state_) : collisionIndex(state_), state(state_) {}
void Placement::placeLayer(RenderSymbolLayer& symbolLayer, bool showCollisionBoxes) {
for (RenderTile& renderTile : symbolLayer.renderTiles) {
+
if (!renderTile.tile.isRenderable()) {
continue;
}
@@ -83,11 +86,15 @@ void Placement::placeLayerBucket(
for (auto& symbolInstance : bucket.symbolInstances) {
+ // TODO symbollayout handles a couple special cases related to this. copy those over if needed.
+ auto anchor = symbolInstance.anchor;
+ const bool withinPlus0 = anchor.point.x >= 0 && anchor.point.x < util::EXTENT && anchor.point.y >= 0 && anchor.point.y < util::EXTENT;
+ if (!withinPlus0) continue;
bool placeText = false;
bool placeIcon = false;
- if (!symbolInstance.isDuplicate) {
+ if (true || !symbolInstance.isDuplicate) {
if (symbolInstance.placedTextIndices.size()) {
assert(symbolInstance.placedTextIndices.size() != 0);
@@ -157,6 +164,7 @@ void Placement::commit(std::unique_ptr<Placement> prevPlacement, TimePoint now)
} else {
float increment = std::chrono::duration<float>(commitTime - prevPlacement->commitTime) / Duration(std::chrono::milliseconds(300));
+ if (increment) {}
// add the opacities from the current placement, and copy their current values from the previous placement
for (auto& placementPair : placements) {
auto prevOpacity = prevPlacement->opacities.find(placementPair.first);
diff --git a/src/mbgl/text/placement.hpp b/src/mbgl/text/placement.hpp
index 50831e0d1c..cbf28601cf 100644
--- a/src/mbgl/text/placement.hpp
+++ b/src/mbgl/text/placement.hpp
@@ -61,8 +61,9 @@ namespace mbgl {
TransformState state;
TimePoint commitTime;
- uint32_t maxCrossTileID = 0;
+ static uint32_t maxCrossTileID; // TODO remove
std::unordered_map<uint32_t,PlacementPair> placements;
std::unordered_map<uint32_t,JointOpacityState> opacities;
};
+
} // namespace mbgl