summaryrefslogtreecommitdiff
path: root/include/mbgl/util
diff options
context:
space:
mode:
authorAnsis Brammanis <brammanis@gmail.com>2016-02-11 15:52:18 -0800
committerAnsis Brammanis <brammanis@gmail.com>2016-02-15 12:55:41 -0800
commit47dc38bf4a4956d63c76c1ab351a0fd08a5f560c (patch)
tree983ed9715fb6d2f8442b280bc8e7f90f1967dedf /include/mbgl/util
parentcdab06306fb5d0f2e74d3264495b166bd440d4f8 (diff)
downloadqtlocation-mapboxgl-47dc38bf4a4956d63c76c1ab351a0fd08a5f560c.tar.gz
[core] less slanted dashed lines near sharp corners
port https://github.com/mapbox/mapbox-gl-js/pull/2043 from -js
Diffstat (limited to 'include/mbgl/util')
-rw-r--r--include/mbgl/util/math.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/mbgl/util/math.hpp b/include/mbgl/util/math.hpp
index 9be0568e12..08625ffc0c 100644
--- a/include/mbgl/util/math.hpp
+++ b/include/mbgl/util/math.hpp
@@ -88,6 +88,11 @@ inline T dist(const S1& a, const S2& b) {
}
template <typename T>
+inline T round(const T& a) {
+ return T(::round(a.x), ::round(a.y));
+}
+
+template <typename T>
inline T length(T a, T b) {
return std::sqrt(a * a + b * b);
}