[core] Check all bucket dynamic_casts

A mismatch can occur when a layer changes from one type to another.
This commit is contained in:
John Firebaugh
2018-07-23 16:08:44 -07:00
parent cb714d57c5
commit 2bbc792060
15 changed files with 122 additions and 34 deletions

View File

@@ -83,8 +83,11 @@ void RenderHeatmapLayer::render(PaintParameters& parameters, RenderSource*) {
parameters.context.clear(Color{ 0.0f, 0.0f, 0.0f, 1.0f }, {}, {});
for (const RenderTile& tile : renderTiles) {
assert(dynamic_cast<HeatmapBucket*>(tile.tile.getBucket(*baseImpl)));
HeatmapBucket& bucket = *reinterpret_cast<HeatmapBucket*>(tile.tile.getBucket(*baseImpl));
auto bucket_ = dynamic_cast<HeatmapBucket*>(tile.tile.getBucket(*baseImpl));
if (!bucket_) {
continue;
}
HeatmapBucket& bucket = *bucket_;
const auto extrudeScale = tile.id.pixelsToTileUnits(1, parameters.state.getZoom());