diff options
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; } |