From 05f548c4e299d9c0fa1690d1ee87ee3bd6b430e5 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Thu, 6 Jul 2017 15:49:22 +0200 Subject: [PATCH] [core] Fix sorting order for render tiles Sort by z order, so lower res tiles don't get rendered over high res tiles. --- src/mbgl/renderer/render_style.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mbgl/renderer/render_style.cpp b/src/mbgl/renderer/render_style.cpp index aacabe563dc..25dbba76f62 100644 --- a/src/mbgl/renderer/render_style.cpp +++ b/src/mbgl/renderer/render_style.cpp @@ -326,6 +326,9 @@ RenderData RenderStyle::getRenderData(MapDebugOptions debugOptions, float angle) return std::tie(par.y, par.x) < std::tie(pbr.y, pbr.x); }); + } else { + std::sort(sortedTiles.begin(), sortedTiles.end(), + [](const auto& a, const auto& b) { return a.get().id < b.get().id; }); } std::vector> sortedTilesForInsertion;