diff options
author | Gali Nelle <galinelle.mapbox@gmail.com> | 2020-04-07 15:06:55 +0300 |
---|---|---|
committer | galinelle <paolo.angelelli@mapbox.com> | 2020-04-08 14:00:26 +0300 |
commit | cd91664935303c2490d6ce9dbfe7d6c719404a95 (patch) | |
tree | c815e9a0d6b104f1516a0d4d1e23e35afab9d303 /include/mbgl/style | |
parent | 8e581c88ea855998a2746e57f1a5fc46ee62faee (diff) | |
download | qtlocation-mapboxgl-cd91664935303c2490d6ce9dbfe7d6c719404a95.tar.gz |
Add unit tests for Rotation interpolator
Diffstat (limited to 'include/mbgl/style')
-rw-r--r-- | include/mbgl/style/rotation.hpp | 6 |
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; } |