summaryrefslogtreecommitdiff
path: root/src/helpers/MiscFunctions.cpp
diff options
context:
space:
mode:
authorozwaldorf <self@ossian.dev>2023-02-01 16:06:01 -0500
committerGitHub <noreply@github.com>2023-02-01 21:06:01 +0000
commit32d56fec977b109aeecb06288a1b45cfe6b83117 (patch)
tree3ac9a6c1f096277cab5675fe47658b6317b45947 /src/helpers/MiscFunctions.cpp
parent1a41f729a38a57c7e925237efdeeaad1df14020e (diff)
feat: border angle animations (#1469)
Co-authored-by: vaxerski <43317083+vaxerski@users.noreply.github.com>
Diffstat (limited to 'src/helpers/MiscFunctions.cpp')
-rw-r--r--src/helpers/MiscFunctions.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp
index 1b0f9467..88e6fa51 100644
--- a/src/helpers/MiscFunctions.cpp
+++ b/src/helpers/MiscFunctions.cpp
@@ -518,3 +518,19 @@ int64_t configStringToInt(const std::string& VALUE) {
}
return std::stoll(VALUE);
}
+
+double normalizeAngleRad(double ang) {
+ if (ang > M_PI * 2) {
+ while (ang > M_PI * 2)
+ ang -= M_PI * 2;
+ return ang;
+ }
+
+ if (ang < 0.0) {
+ while (ang < 0.0)
+ ang += M_PI * 2;
+ return ang;
+ }
+
+ return ang;
+} \ No newline at end of file