summaryrefslogtreecommitdiff
path: root/src/mbgl/layout
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-12-21 09:51:04 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-12-21 13:42:30 -0800
commit029805f7296aae49ce1578b76491acb1a2ae5f7d (patch)
treef6da0d5dd23a4e88ba347e2023e496f07649a1de /src/mbgl/layout
parentbcf2c3ff9e02b1ab11c41824ac8c13aafeae9ffa (diff)
downloadqtlocation-mapboxgl-029805f7296aae49ce1578b76491acb1a2ae5f7d.tar.gz
[core] Replace magic number with constant-based calculation
Diffstat (limited to 'src/mbgl/layout')
-rw-r--r--src/mbgl/layout/symbol_layout.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mbgl/layout/symbol_layout.cpp b/src/mbgl/layout/symbol_layout.cpp
index 387bb7fb00..351858f6f8 100644
--- a/src/mbgl/layout/symbol_layout.cpp
+++ b/src/mbgl/layout/symbol_layout.cpp
@@ -313,8 +313,8 @@ void SymbolLayout::addFeature(const SymbolFeature& feature,
poly.push_back(r);
}
- // 16 here represents 2 pixels
- auto poi = mapbox::polylabel(poly, 16.0);
+ // 1 pixel worth of precision, in tile coordinates
+ auto poi = mapbox::polylabel(poly, double(util::EXTENT / util::tileSize));
Anchor anchor(poi.x, poi.y, 0, minScale);
addSymbolInstance(polygon[0], anchor);
}