[core] Fix placement for updated buckets

Buckets update initiates new placement, so that
newly added symbols are placed and shown immediately.
This commit is contained in:
Mikhail Pozdnyakov
2019-08-04 15:48:12 +03:00
parent 69bc5244ea
commit f9c15f708e
2 changed files with 10 additions and 16 deletions

View File

@@ -699,7 +699,7 @@ void Placement::updateBucketOpacities(SymbolBucket& bucket, const TransformState
if (bucket.hasTextCollisionBoxData()) bucket.textCollisionBox->dynamicVertices.clear();
if (bucket.hasTextCollisionCircleData()) bucket.textCollisionCircle->dynamicVertices.clear();
JointOpacityState duplicateOpacityState(false, false, true);
const JointOpacityState duplicateOpacityState(false, false, true);
const bool textAllowOverlap = bucket.layout->get<style::TextAllowOverlap>();
const bool iconAllowOverlap = bucket.layout->get<style::IconAllowOverlap>();
@@ -712,7 +712,7 @@ void Placement::updateBucketOpacities(SymbolBucket& bucket, const TransformState
// But we have to wait for placement if we potentially depend on a paired icon/text
// with allow-overlap: false.
// See https://github.com/mapbox/mapbox-gl-native/issues/12483
JointOpacityState defaultOpacityState(
const JointOpacityState defaultOpacityState(
textAllowOverlap && (iconAllowOverlap || !(bucket.hasIconData() || bucket.hasSdfIconData()) || bucket.layout->get<style::IconOptional>()),
iconAllowOverlap && (textAllowOverlap || !bucket.hasTextData() || bucket.layout->get<style::TextOptional>()),
true);
@@ -728,10 +728,6 @@ void Placement::updateBucketOpacities(SymbolBucket& bucket, const TransformState
opacityState = it->second;
}
if (it == opacities.end()) {
opacities.emplace(symbolInstance.crossTileID, defaultOpacityState);
}
seenCrossTileIDs.insert(symbolInstance.crossTileID);
if (symbolInstance.hasText()) {