[Kstars-devel] KDE/kdeedu/kstars/kstars/tools

Jason Harris kstars at 30doradus.org
Thu Jul 24 07:45:10 CEST 2008


SVN commit 837185 by harris:

When changing the year or location, delete the old plot items before adding the 
new ones.

CCMAIL: kstars-devel at kde.org


 M  +7 -4      skycalendar.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/tools/skycalendar.cpp #837184:837185
@@ -59,6 +59,9 @@
 int SkyCalendar::year()  { return scUI->Year->value(); }
 
 void SkyCalendar::slotFillCalendar() {
+    scUI->CalendarView->resetPlot();
+    scUI->CalendarView->setLimits( -9.0, 9.0, 0.0, 366.0 );
+    
     addPlanetEvents( KSPlanetBase::MERCURY );
     addPlanetEvents( KSPlanetBase::VENUS );
     addPlanetEvents( KSPlanetBase::MARS );
@@ -122,17 +125,17 @@
         if ( i > 0 && fabs(vRise.at(i).x() - vRise.at(i-1).x()) > 6.0 ) { 
             scUI->CalendarView->addPlotObject( oRise );
             oRise = new KPlotObject( pColor, KPlotObject::Lines, 2.0 );
-            update();
+            scUI->CalendarView->update();
         }
         if ( i > 0 && fabs(vSet.at(i).x() - vSet.at(i-1).x()) > 6.0 ) {
             scUI->CalendarView->addPlotObject( oSet );
             oSet = new KPlotObject( pColor, KPlotObject::Lines, 2.0 );
-            update();
+            scUI->CalendarView->update();
         }
         if ( i > 0 && fabs(vTransit.at(i).x() - vTransit.at(i-1).x()) > 6.0 ) {
             scUI->CalendarView->addPlotObject( oTransit );
             oTransit = new KPlotObject( pColor, KPlotObject::Lines, 2.0 );
-            update();
+            scUI->CalendarView->update();
         }
         
         oRise->addPoint( vRise.at(i) );
@@ -143,7 +146,7 @@
     scUI->CalendarView->addPlotObject( oRise );
     scUI->CalendarView->addPlotObject( oSet );
     scUI->CalendarView->addPlotObject( oTransit );
-    update();
+    scUI->CalendarView->update();
 }
 
 void SkyCalendar::slotPrint() {


More information about the Kstars-devel mailing list