From 47dc38bf4a4956d63c76c1ab351a0fd08a5f560c Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Thu, 11 Feb 2016 15:52:18 -0800 Subject: [core] less slanted dashed lines near sharp corners port https://github.com/mapbox/mapbox-gl-js/pull/2043 from -js --- include/mbgl/util/math.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/mbgl/util') 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 @@ -87,6 +87,11 @@ inline T dist(const S1& a, const S2& b) { return c; } +template +inline T round(const T& a) { + return T(::round(a.x), ::round(a.y)); +} + template inline T length(T a, T b) { return std::sqrt(a * a + b * b); -- cgit v1.2.1