Skip to content
Snippets Groups Projects
Commit d605210d authored by Akarsh Simha's avatar Akarsh Simha
Browse files

Fix precession bug: Reset lastPrecessJD when star data is reinitialized

We now recompute precession corrections only if there has been a large
shift in time.

With dynamically loaded stars (DeepStarComponent), the star object is
recycled in memory to avoid the overhead of memory allocation and
construction. The new star data is re-initialized in a pre-existing
StarObject by calling StarObject::init() with the new data.

Since we added the lastPrecessJD much later, it has to be initialized
in StarObject::init(); otherwise, the catalog coordinates will not be
precessed when a previously existing StarObject is re-purposed for a
new star.

CCMAIL: kstars-devel@kde.org, mutlaqja@ikarustech.com
parent f9e21e4a
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@
#include "kspopupmenu.h"
#include "ksnumbers.h"
#include "kstarsdata.h"
#include "kstarsdatetime.h"
#include "Options.h"
#include "skymap.h"
#include "ksutils.h"
......@@ -181,6 +182,7 @@ void StarObject::init( const starData *stardata )
*/
// END DEBUG.
lastPrecessJD = J2000;
}
......@@ -225,6 +227,7 @@ void StarObject::init( const deepStarData *stardata )
updateID = updateNumID = 0;
B = stardata->B / 1000.0;
V = stardata->V / 1000.0;
lastPrecessJD = J2000;
}
void StarObject::setNames( QString name, QString name2 ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment