AngleSpinBox.cpp   AngleSpinBox.cpp
skipping to change at line 359 skipping to change at line 359
sign = false; sign = false;
} }
angle = fmod(angle,2.0*M_PI); angle = fmod(angle,2.0*M_PI);
angle *= 180./M_PI; angle *= 180./M_PI;
d = (int)angle; d = (int)angle;
m = (int)((angle - d)*60); m = (int)((angle - d)*60);
s = (angle-d)*3600-60*m; s = (angle-d)*3600-60*m;
// we may have seconds as 60 and one less minute... // we may have seconds as 60 and one less minute...
if (s > 60.0 - ::pow(10, -1 * (decimalPlaces+1))) if (s > 60.0 - ::pow(10.0, -1 * (decimalPlaces+1)))
{ {
m+=1; m+=1;
s-=60.0; s-=60.0;
} }
// may have to carry to the degrees... // may have to carry to the degrees...
if (m >= 60) if (m >= 60)
{ {
d= (d+1) % 360; d= (d+1) % 360;
m-=60; m-=60;
} }
// fix when we have tiny tiny tiny values. // fix when we have tiny tiny tiny values.
if (s < ::pow(10, -1 * (decimalPlaces+1))) if (s < ::pow(10.0, -1 * (decimalPlaces+1)))
s= 0.0; s= 0.0;
else if (s < 0.0 && 0.0 - ::pow(10ces+1))) else if (s < 0.0 && 0.0 - ::pow(10.0, -1 * (decimalP laces+1)))
s= 0.0; s= 0.0;
QString signInd = positivePrefix(currentPrefixType); QString signInd = positivePrefix(currentPrefixType);
if (!sign) if (!sign)
signInd = negativePrefix(currentPrefixType); signInd = negativePrefix(currentPrefixType);
if (angleSpinBoxFormat == DMSLetters) if (angleSpinBoxFormat == DMSLetters)
lineEdit()->setText(QString("%1%2d %3m %4s") lineEdit()->setText(QString("%1%2d %3m %4s")
.arg(signInd).arg(d).arg(m).arg(s, 0, ' f', decimalPlaces, ' ')); .arg(signInd).arg(d).arg(m).arg(s, 0, ' f', decimalPlaces, ' '));
else else
skipping to change at line 405 skipping to change at line 405
double s; double s;
angle = fmod(angle,2.0*M_PI); angle = fmod(angle,2.0*M_PI);
if (angle < 0.0) angle += 2.0*M_PI; // range: [0..2. 0*M_PI) if (angle < 0.0) angle += 2.0*M_PI; // range: [0..2. 0*M_PI)
angle *= 12./M_PI; angle *= 12./M_PI;
h = (unsigned int)angle; h = (unsigned int)angle;
m = (unsigned int)((angle-h)*60); m = (unsigned int)((angle-h)*60);
s = (angle-h)*3600.-60.*m; s = (angle-h)*3600.-60.*m;
// we may have seconds as 60 and one less minute... // we may have seconds as 60 and one less minute...
if (s > 60.0 - ::pow(10, -1 * (decimalPlaces+1))) if (s > 60.0 - ::pow(10.0, -1 * (decimalPlaces+1)))
{ {
m+=1; m+=1;
s-=60.0; s-=60.0;
} }
// may have to carry to the degrees... // may have to carry to the degrees...
if (m >= 60) if (m >= 60)
{ {
h = (h+1) % 24; h = (h+1) % 24;
m-=60; m-=60;
} }
// fix when we have tiny tiny tiny values. // fix when we have tiny tiny tiny values.
if (s < ::pow(10, -1 * (decimalPlaces+1))) if (s < ::pow(10.0, -1 * (decimalPlaces+1)))
s= 0.0; s= 0.0;
else if (s < 0.0 && 0.0 - ::pow(10ces+1))) else if (s < 0.0 && 0.0 - ::pow(10.0, -1 * (decimalP laces+1)))
s= 0.0; s= 0.0;
if (angleSpinBoxFormat == HMSLetters) if (angleSpinBoxFormat == HMSLetters)
lineEdit()->setText(QString("%1h %2m %3s") lineEdit()->setText(QString("%1h %2m %3s")
.arg(h).arg(m).arg(s, 0, 'f', decimalPl aces, ' ')); .arg(h).arg(m).arg(s, 0, 'f', decimalPl aces, ' '));
else else
lineEdit()->setText(QString("%1h %2' %3\"") lineEdit()->setText(QString("%1h %2' %3\"")
.arg(h).arg(m).arg(s, 0, 'f', decimalPl aces, ' ')); .arg(h).arg(m).arg(s, 0, 'f', decimalPl aces, ' '));
break; break;
} }
End of changes. 6 change blocks.
6 lines changed or deleted 6 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/