summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <[email protected]>2015-06-29 12:10:21 +0300
committerJasem Mutlaq <[email protected]>2015-06-29 12:10:21 +0300
commit06a027c97ad8f886c1f9a574959dc551076555d9 (patch)
treef9e2279fb1f750a8a3f49fb865347387db794fc7
parentd9e6a5121ae775adae26d3f2f570580d006fa7ea (diff)
Fix loading of andromeda image example. use EquatorialToHorizontal so that Az/Alt are updated
-rw-r--r--kstars/skyqpainter.cpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/kstars/skyqpainter.cpp b/kstars/skyqpainter.cpp
index 0fd0a4b..0fb4b61 100644
--- a/kstars/skyqpainter.cpp
+++ b/kstars/skyqpainter.cpp
@@ -423,29 +423,35 @@ void SkyQPainter::drawPointSource(const QPointF& pos, float size, char sp)
bool SkyQPainter::drawConstellationArtImage(ConstellationsArt *obj, bool drawConstellationImage)
{
- KStarsData *data = KStarsData::Instance();
+ // KStarsData *data = KStarsData::Instance();
//Updating the position of star1 and star2 before drawing.
- obj->star1->updateCoords(data->updateNum());
- obj->star2->updateCoords(data->updateNum());
+ //obj->star1->updateCoords(data->updateNum());
+ //obj->star2->updateCoords(data->updateNum());
- if ((!m_proj->checkVisibility(obj->star1))&&(!m_proj->checkVisibility(obj->star2))) return false;
+ bool visible = false;
+ obj->star1->EquatorialToHorizontal(KStarsData::Instance()->lst(), KStarsData::Instance()->geo()->lat());
+ QPointF p1 = m_proj->toScreen(obj->star1, true, &visible);
+ if ( !visible || !m_proj->onScreen(p1))
+ return false;
- QPointF position1 = m_proj->toScreen(obj->star1, true);
- QPointF position2 = m_proj->toScreen(obj->star2, true);
- qDebug()<<"THE STAR POSITION IS"<<position1<<position2;
+ //if ((!m_proj->checkVisibility(obj->star1))&&(!m_proj->checkVisibility(obj->star2))) return false;
+
+ //QPointF position1 = m_proj->toScreen(obj->star1, true);
+ //QPointF position2 = m_proj->toScreen(obj->star2, true);
+ qDebug() << "THE STAR POSITION IS" << p1;
int w = obj->imageWidth();
int h = obj->imageHeight();
- if((m_proj->onScreen(position1))&&(m_proj->onScreen(position2))) {
- begin();
+ //if((m_proj->onScreen(position1))&&(m_proj->onScreen(position2))) {
+ //begin();
save();
- translate(position1);
+ translate(p1);
drawImage( QRect(-0.5*w, -0.5*h, w, h), obj->image() );
restore();
- end();
- }
+ //end();
+ //}
return true;
}