diff options
author | Ansis Brammanis <brammanis@gmail.com> | 2015-08-14 19:34:13 +0300 |
---|---|---|
committer | Ansis Brammanis <brammanis@gmail.com> | 2015-08-24 18:41:50 -0400 |
commit | 554425b753c1eee6b6874f1ddde0c266a717c88e (patch) | |
tree | 85469fd9195538c314933f29b859c510793729ca /src/mbgl/util/mat2.cpp | |
parent | bc92c2de3988a39d6def34617ade4afb5b82e214 (diff) | |
download | qtlocation-mapboxgl-554425b753c1eee6b6874f1ddde0c266a717c88e.tar.gz |
fix earthquakes in perspective view
Use higher precision for matrix calculations so that the map does not
jump around while zooming.
Diffstat (limited to 'src/mbgl/util/mat2.cpp')
-rw-r--r-- | src/mbgl/util/mat2.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mbgl/util/mat2.cpp b/src/mbgl/util/mat2.cpp index 05900d1667..6910244541 100644 --- a/src/mbgl/util/mat2.cpp +++ b/src/mbgl/util/mat2.cpp @@ -33,8 +33,8 @@ void matrix::identity(mat2& out) { out[3] = 1.0f; } -void matrix::rotate(mat2& out, const mat2& a, float rad) { - float a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], +void matrix::rotate(mat2& out, const mat2& a, double rad) { + double a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], s = std::sin(rad), c = std::cos(rad); out[0] = a0 * c + a2 * s; @@ -43,8 +43,8 @@ void matrix::rotate(mat2& out, const mat2& a, float rad) { out[3] = a1 * -s + a3 * c; }; -void matrix::scale(mat2& out, const mat2& a, float v0, float v1) { - float a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3]; +void matrix::scale(mat2& out, const mat2& a, double v0, double v1) { + double a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3]; out[0] = a0 * v0; out[1] = a1 * v0; out[2] = a2 * v1; |