Skip to content

Commit

Permalink
Fix scaling right axes on graphs (fix #2578, #2582)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-w committed Aug 16, 2022
1 parent 9c27955 commit f1c2c10
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gui/AstroCalcChart.cpp
Expand Up @@ -574,11 +574,11 @@ void AstroCalcChart::setYrangeR(Series series, qreal min, qreal max)
const double logYDiff=log10(yMaxR-yMinR);
const double s=pow(10., floor(logYDiff)-1.);

qreal rMin=floor(yMinR/s);
qreal rMax=ceil(yMaxR/s);
qreal rMin=floor(yMinR/s)*s;
qreal rMax=ceil(yMaxR/s)*s;

//qDebug() << "Setting yrangeR from" << min << "/" << max << "-->" << rMin*s << "/" << rMax*s;
yAxisR->setRange(rMin*s, rMax*s);
yAxisR->setRange(rMin, rMax);
if (rMax-rMin > 3*s)
{
yAxisR->setTickCount(6+1);
Expand Down

0 comments on commit f1c2c10

Please sign in to comment.