summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-30 13:05:03 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-30 13:05:03 (GMT)
commit2052307d9e427c7ebe795de634cabfd849cf4de5 (patch)
tree225f44302d3541946bff980657730ddf2eaaa9b2
parente1ecb2133ad21b2a3afbb13e493af06b64b95ed0 (diff)
Deprecess an empty point when we add a flag, otherwise use ra0/de0 from the object
-rw-r--r--kstars/skymap.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/kstars/skymap.cpp b/kstars/skymap.cpp
index 213b542..ac42297 100644
--- a/kstars/skymap.cpp
+++ b/kstars/skymap.cpp
@@ -603,13 +603,32 @@ void SkyMap::slotCancelRulerMode(void) {
AngularRuler.clear();
}
-void SkyMap::slotAddFlag() {
+void SkyMap::slotAddFlag()
+{
KStars *ks = KStars::Instance();
// popup FlagManager window and update coordinates
ks->slotFlagManager();
ks->flagManager()->clearFields();
- ks->flagManager()->setRaDec( clickedPoint()->ra0(), clickedPoint()->dec0() );
+
+ //ra and dec must be the coordinates at J2000. If we clicked on an object, just use the object's ra0, dec0 coords
+ //if we clicked on empty sky, we need to precess to J2000.
+
+ dms J2000RA, J2000DE;
+
+ if ( clickedObject() )
+ {
+ J2000RA = clickedObject()->ra0();
+ J2000DE = clickedObject()->dec0();
+ }
+ else
+ {
+ SkyPoint deprecessedPoint = clickedPoint()->deprecess( data->updateNum() );
+ J2000RA = deprecessedPoint.ra();
+ J2000DE = deprecessedPoint.dec();
+ }
+
+ ks->flagManager()->setRaDec(J2000RA, J2000DE);
}
void SkyMap::slotEditFlag( int flagIdx ) {