From 9361cbfd5fc92538cfd5d7ef8bdaf83394861f9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Thu, 2 Jul 2015 10:21:15 -0700 Subject: [PATCH] Fixed round-tripping between pixelForLatLng() / latLngForPixel() Followup to cfa2eaf5c21858483cd12ee0768b43315ef29e95 for #1406. --- src/mbgl/map/transform_state.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mbgl/map/transform_state.cpp b/src/mbgl/map/transform_state.cpp index 3c4acc7e0..6a0c2a0d6 100644 --- a/src/mbgl/map/transform_state.cpp +++ b/src/mbgl/map/transform_state.cpp @@ -218,8 +218,8 @@ const LatLng TransformState::latLngForPixel(const vec2 pixel) const { LatLng ll = getLatLng(); double zoom = getZoom(); - const double centerX = width / 2; - const double centerY = height / 2; + const double centerX = static_cast(width) / 2.0; + const double centerY = static_cast(height) / 2.0; const double m = Projection::getMetersPerPixelAtLatitude(0, zoom);