summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2017-11-03 11:25:31 -0700
committerChris Loer <chris.loer@gmail.com>2017-11-03 11:25:31 -0700
commit13871d41c7f2b8bee06244bde18cf0ac9ffbc6ff (patch)
tree0034b35a49f2bed3e65257d9b4ad47119bda11cf
parent8d609edd878099bb805746720b592fbea6383139 (diff)
downloadqtlocation-mapboxgl-13871d41c7f2b8bee06244bde18cf0ac9ffbc6ff.tar.gz
Fix "scale" and "textPixelRatio" calculations -- both of them need to include overscaling factor, instead of neither.
-rw-r--r--src/mbgl/text/placement.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mbgl/text/placement.cpp b/src/mbgl/text/placement.cpp
index 9e133cb1ef..399243f363 100644
--- a/src/mbgl/text/placement.cpp
+++ b/src/mbgl/text/placement.cpp
@@ -54,9 +54,8 @@ void Placement::placeLayer(RenderSymbolLayer& symbolLayer, const mat4& projMatri
const float pixelsToTileUnits = renderTile.id.pixelsToTileUnits(1, state.getZoom());
- const float scale = std::pow(2, state.getZoom() - renderTile.id.canonical.z);
-
- const float textPixelRatio = util::EXTENT / util::tileSize;
+ const float scale = std::pow(2, state.getZoom() - renderTile.tile.id.overscaledZ);
+ const float textPixelRatio = util::EXTENT / (util::tileSize * renderTile.tile.id.overscaleFactor());
mat4 posMatrix;
state.matrixFor(posMatrix, renderTile.id);