summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDane Springmeyer <dane@mapbox.com>2015-05-03 23:28:52 -0700
committerDane Springmeyer <dane@mapbox.com>2015-05-03 23:28:52 -0700
commitcfa2eaf5c21858483cd12ee0768b43315ef29e95 (patch)
treeea1e10e5121d0fb39637504ee706ba4199fc5266 /src
parent33f30aae933bd407c8e2304b37d0e5b4b9838e35 (diff)
downloadqtlocation-mapboxgl-cfa2eaf5c21858483cd12ee0768b43315ef29e95.tar.gz
fix more 'result is not floating point' coverity warnings
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/map/transform_state.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mbgl/map/transform_state.cpp b/src/mbgl/map/transform_state.cpp
index 507e63f67e..2a1cc4b9ea 100644
--- a/src/mbgl/map/transform_state.cpp
+++ b/src/mbgl/map/transform_state.cpp
@@ -31,8 +31,8 @@ box TransformState::cornersToBox(uint32_t z) const {
const double angle_sin = std::sin(-angle);
const double angle_cos = std::cos(-angle);
- const double w_2 = width / 2;
- const double h_2 = height / 2;
+ const double w_2 = static_cast<double>(width) / 2.0;
+ const double h_2 = static_cast<double>(height) / 2.0;
const double ss_0 = scale * util::tileSize;
const double ss_1 = ref_scale / ss_0;
const double ss_2 = ss_0 / 2.0;
@@ -166,8 +166,8 @@ const vec2<double> TransformState::pixelForLatLng(const LatLng latLng) const {
LatLng ll = getLatLng();
double zoom = getZoom();
- const double centerX = width / 2;
- const double centerY = height / 2;
+ const double centerX = static_cast<double>(width) / 2.0;
+ const double centerY = static_cast<double>(height) / 2.0;
const double m = Projection::getMetersPerPixelAtLatitude(0, zoom);