diff options
author | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2017-12-12 15:53:06 -0800 |
---|---|---|
committer | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2017-12-12 16:27:37 -0800 |
commit | 275813930b2006205e8ecdf6282485dd06552ba9 (patch) | |
tree | f064975afc5d02251790256c52271a63adc6c29b | |
parent | b4e8af113de59d5d24fb8950f8e2d85565cb643b (diff) | |
download | qtlocation-mapboxgl-upstream/fix-overzoomed-imgsrc-vanish.tar.gz |
Update commentupstream/fix-overzoomed-imgsrc-vanish
-rw-r--r-- | src/mbgl/renderer/sources/render_image_source.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mbgl/renderer/sources/render_image_source.cpp b/src/mbgl/renderer/sources/render_image_source.cpp index e2e742167b..d215dc8d13 100644 --- a/src/mbgl/renderer/sources/render_image_source.cpp +++ b/src/mbgl/renderer/sources/render_image_source.cpp @@ -135,10 +135,10 @@ void RenderImageSource::update(Immutable<style::Source::Impl> baseImpl_, // Only enable if the long side of the image is > 2 pixels. Resulting in a // display of at least 2 x 1 px image - // dMax is in tile coordinate units at z0, so scale by util::EXTENT and then - // by 2^z to get geometry coordinates at the current zoom. - // 1 gc unit = tileSize / extent pixels. - enabled = dMax * std::pow( 2.0, transformState.getZoom()) * util::tileSize > 2.0; + // A tile coordinate unit represents the length of one tile (tileSize) at a given zoom. + // To convert a tile coordinate to pixels, multiply by tileSize. + // Here dMax is in z0 tile units, so we also scale by 2^z to match current zoom. + enabled = dMax * std::pow(2.0, transformState.getZoom()) * util::tileSize > 2.0; if (!enabled) { return; } |