summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGali Nelle <galinelle.mapbox@gmail.com>2020-04-07 15:06:55 +0300
committergalinelle <paolo.angelelli@mapbox.com>2020-04-08 14:00:26 +0300
commitcd91664935303c2490d6ce9dbfe7d6c719404a95 (patch)
treec815e9a0d6b104f1516a0d4d1e23e35afab9d303 /include
parent8e581c88ea855998a2746e57f1a5fc46ee62faee (diff)
downloadqtlocation-mapboxgl-cd91664935303c2490d6ce9dbfe7d6c719404a95.tar.gz
Add unit tests for Rotation interpolator
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/style/rotation.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/mbgl/style/rotation.hpp b/include/mbgl/style/rotation.hpp
index 862ede93b7..96b047c68c 100644
--- a/include/mbgl/style/rotation.hpp
+++ b/include/mbgl/style/rotation.hpp
@@ -1,5 +1,5 @@
#pragma once
-
+#include <mbgl/math/wrap.hpp>
namespace mbgl {
namespace style {
@@ -9,8 +9,8 @@ namespace style {
class Rotation {
public:
Rotation() = default;
- Rotation(double angle_) : angle(angle_) {}
- double period() const noexcept { return 360.0; }
+ Rotation(double angle_) : angle(mbgl::util::wrap<double>(angle_, 0, period())) {}
+ constexpr double period() const noexcept { return 360.0; }
double getAngle() const noexcept { return angle; }
friend bool operator==(const Rotation& lhs, const Rotation& rhs) { return lhs.angle == rhs.angle; }