Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ansis committed Dec 6, 2019
1 parent 420e4e3 commit 2534f87
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/mbgl/text/placement.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#include <mbgl/text/placement.hpp>

#include <list>
#include <mbgl/layout/symbol_layout.hpp>
#include <mbgl/renderer/bucket.hpp>
#include <mbgl/renderer/buckets/symbol_bucket.hpp>
#include <mbgl/renderer/render_layer.hpp>
#include <mbgl/renderer/render_tile.hpp>
#include <mbgl/text/placement.hpp>
#include <mbgl/tile/geometry_tile.hpp>
#include <mbgl/renderer/buckets/symbol_bucket.hpp>
#include <mbgl/renderer/bucket.hpp>
#include <mbgl/util/math.hpp>
#include <utility>
#include <list>

namespace mbgl {

Expand Down Expand Up @@ -146,11 +145,22 @@ void Placement::placeLayer(const RenderLayer& layer, const mat4& projMatrix, boo
for (auto& params : parameters) {
SymbolBucket& bucket = params.bucket;
bucket.place(*this, params, seenCrossTileIDs);

bucket.justReloaded = false;

const OverscaledTileID& overscaledID = params.tile.getOverscaledTileID();

// As long as this placement lives, we have to hold onto this bucket's
// matching FeatureIndex/data for querying purposes
retainedQueryData.emplace(std::piecewise_construct,
std::forward_as_tuple(bucket.bucketInstanceId),
std::forward_as_tuple(bucket.bucketInstanceId, params.featureIndex, overscaledID));
}
}

namespace {
Point<float> calculateVariableLayoutOffset(style::SymbolAnchorType anchor, float width, float height, std::array<float, 2> offset, float textBoxScale) {
Point<float> calculateVariableLayoutOffset(
style::SymbolAnchorType anchor, float width, float height, std::array<float, 2> offset, float textBoxScale) {
AnchorAlignment alignment = AnchorAlignment::getAnchorAlignment(anchor);
float shiftX = -(alignment.horizontalAlign - 0.5f) * width;
float shiftY = -(alignment.verticalAlign - 0.5f) * height;
Expand Down Expand Up @@ -552,14 +562,6 @@ void Placement::placeBucket(
placeSymbol(*it);
}
}

bucket.justReloaded = false;

// As long as this placement lives, we have to hold onto this bucket's
// matching FeatureIndex/data for querying purposes
retainedQueryData.emplace(std::piecewise_construct,
std::forward_as_tuple(bucket.bucketInstanceId),
std::forward_as_tuple(bucket.bucketInstanceId, params.featureIndex, overscaledID));
}

void Placement::commit(TimePoint now, const double zoom) {
Expand Down

0 comments on commit 2534f87

Please sign in to comment.