summaryrefslogtreecommitdiff
path: root/src/mbgl/util/mat2.cpp
diff options
context:
space:
mode:
authorAnsis Brammanis <brammanis@gmail.com>2015-08-14 19:34:13 +0300
committerAnsis Brammanis <brammanis@gmail.com>2015-08-24 18:41:50 -0400
commit554425b753c1eee6b6874f1ddde0c266a717c88e (patch)
tree85469fd9195538c314933f29b859c510793729ca /src/mbgl/util/mat2.cpp
parentbc92c2de3988a39d6def34617ade4afb5b82e214 (diff)
downloadqtlocation-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.cpp8
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;