diff options
-rw-r--r-- | src/mbgl/tile/geometry_tile.cpp | 11 | ||||
-rw-r--r-- | src/mbgl/tile/geometry_tile.hpp | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/mbgl/tile/geometry_tile.cpp b/src/mbgl/tile/geometry_tile.cpp index ad5c2edd4c..1ee303b50f 100644 --- a/src/mbgl/tile/geometry_tile.cpp +++ b/src/mbgl/tile/geometry_tile.cpp @@ -42,7 +42,8 @@ GeometryTile::GeometryTile(const OverscaledTileID& id_, parameters.pixelRatio), glyphManager(parameters.glyphManager), imageManager(parameters.imageManager), - placementThrottler(Milliseconds(300), [this] { invokePlacement(); }) { + placementThrottler(Milliseconds(300), [this] { invokePlacement(); }), + lastYStretch(1.0f) { } GeometryTile::~GeometryTile() { @@ -143,6 +144,9 @@ void GeometryTile::onPlacement(PlacementResult result) { if (result.iconAtlasImage) { iconAtlasImage = std::move(*result.iconAtlasImage); } + if (collisionTile.get()) { + lastYStretch = collisionTile->yStretch; + } observer->onTileChanged(*this); } @@ -265,7 +269,10 @@ void GeometryTile::querySourceFeatures( } float GeometryTile::yStretch() const { - return collisionTile->yStretch; + // collisionTile gets reset in onLayout but we don't clear the symbolBuckets + // until a new placement result comes along, so keep the yStretch value in + // case we need to render them. + return lastYStretch; } } // namespace mbgl diff --git a/src/mbgl/tile/geometry_tile.hpp b/src/mbgl/tile/geometry_tile.hpp index 3e2efe1093..943296e01b 100644 --- a/src/mbgl/tile/geometry_tile.hpp +++ b/src/mbgl/tile/geometry_tile.hpp @@ -122,6 +122,7 @@ private: std::unique_ptr<CollisionTile> collisionTile; util::Throttler placementThrottler; + float lastYStretch; public: optional<gl::Texture> glyphAtlasTexture; |