From kde-commits Sat May 07 19:46:20 2011 From: Khudyakov Alexey Date: Sat, 07 May 2011 19:46:20 +0000 To: kde-commits Subject: =?utf-8?q?=5Bkstars/4=2E6=5D_kstars/tools=3A_Set_initial_guesses?= Message-Id: <20110507194620.03A5EA60C9 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=130479764631496 Git commit 1a74061721dd0757e6efada938f38037d0c4f1b1 by Khudyakov Alexey. Committed on 07/05/2011 at 20:39. Pushed by khudyakov into branch '4.6'. Set initial guesses for calculation of equinox to February 1 and August 1 to be sure that the are before equinox. Backport fix for #272721 to 4.6 M +5 -4 kstars/tools/modcalcvizequinox.cpp http://commits.kde.org/kstars/1a74061721dd0757e6efada938f38037d0c4f1b1 diff --git a/kstars/tools/modcalcvizequinox.cpp b/kstars/tools/modcalcvizequinox.cpp index 87d5e6f..5ee1ca1 100644 --- a/kstars/tools/modcalcvizequinox.cpp +++ b/kstars/tools/modcalcvizequinox.cpp @@ -251,10 +251,11 @@ void modCalcEquinox::addDateAxes() { } KStarsDateTime modCalcEquinox::findEquinox( int year, bool Spring, KPlotObject *ecl ) { - //Interpolate to find the moment when the Sun crosses the equator in March - int month = 3; - if ( ! Spring ) month = 9; - int i = QDate( year, month, 16 ).dayOfYear(); + // Interpolate to find the moment when the Sun crosses the equator + // Set initial guess in February or August to be sure that this + // point is before equinox. + const int month = Spring ? 2 : 8; + int i = QDate( year, month, 1 ).dayOfYear(); double dec1, dec2; dec2 = ecl->points()[i]->y(); do {