summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander V. Wolf <alex.v.wolf@gmail.com>2022-01-30 18:14:08 +0700
committerAlexander V. Wolf <alex.v.wolf@gmail.com>2022-01-30 18:14:08 +0700
commitaacf8ef25a751813a1fa382c3cf1698923fc5549 (patch)
tree16231aab04e21cb1dbd68b7d0652afc519cb2374
parent92a1ecc13ee5b9e1dc24fb91236ca42ab3228065 (diff)
Additional fix for galactic and supergalactic longitudes range (fix #2219)
-rw-r--r--src/core/StelObject.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/StelObject.cpp b/src/core/StelObject.cpp
index 520ef59e50..20ae422eae 100644
--- a/src/core/StelObject.cpp
+++ b/src/core/StelObject.cpp
@@ -985,12 +985,14 @@ QVariantMap StelObject::getInfoMap(const StelCore *core) const
// galactic long/lat
pos = getGalacticPos(core);
StelUtils::rectToSphe(&glong, &glat, pos);
+ if (glong<0.) glong += 2.0*M_PI;
map.insert("glong", glong*M_180_PI);
map.insert("glat", glat*M_180_PI);
// supergalactic long/lat
pos = getSupergalacticPos(core);
StelUtils::rectToSphe(&glong, &glat, pos);
+ if (glong<0.) glong += 2.0*M_PI;
map.insert("sglong", glong*M_180_PI);
map.insert("sglat", glat*M_180_PI);