[Kstars-devel] [kstars] kstars/tools: Attach labels to the curves in Alt vs Time tool.
Jérome SONRIER
jsid at emor3j.fr.eu.org
Thu Jul 14 20:53:55 CEST 2011
Git commit 69cf2fbf30fea7ad67f74db831e86e58bdd25c24 by Jérome SONRIER.
Committed on 14/07/2011 at 20:45.
Pushed by jsonrier into branch 'master'.
Attach labels to the curves in Alt vs Time tool.
CCBUG: 115518
CCMAIL: kstars-devel at kde.org
M +7 -1 kstars/tools/altvstime.cpp
http://commits.kde.org/kstars/69cf2fbf30fea7ad67f74db831e86e58bdd25c24
diff --git a/kstars/tools/altvstime.cpp b/kstars/tools/altvstime.cpp
index fa7b798..e98de63 100644
--- a/kstars/tools/altvstime.cpp
+++ b/kstars/tools/altvstime.cpp
@@ -247,7 +247,13 @@ void AltVsTime::processObject( SkyObject *o, bool forceAdd ) {
//add new curve with width=2, and color=white
KPlotObject *po = new KPlotObject( Qt::white, KPlotObject::Lines, 2.0 );
for ( double h=-12.0; h<=12.0; h+=0.5 ) {
- po->addPoint( h, findAltitude( o, h ) );
+ int label_pos = -11.0 + avtUI->View->plotObjects().count();
+ while ( label_pos > 11.0 )
+ label_pos -= 23.0;
+ if( h == label_pos )
+ po->addPoint( h, findAltitude( o, h ), o->translatedName() );
+ else
+ po->addPoint( h, findAltitude( o, h ) );
}
avtUI->View->addPlotObject( po );
More information about the Kstars-devel
mailing list