Skip to content

Commit

Permalink
Change 'fix now' semantic when already fixed scale
Browse files Browse the repository at this point in the history
Now it changes to auto scale and then fixes it.
Otherwise this button is meaningless in 'fixed' mode
  • Loading branch information
NIA committed Jul 20, 2014
1 parent 495ea01 commit 53facfd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/gui/timeplot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,18 @@ void TimePlot::setFixedScaleYMin(double min) {
}

void TimePlot::fixCurrent() {
if ( ! fixedScale ) {
if (fixedScale) {
// If already fixed scale, switch to autoscale and back
setAxisAutoScale(yLeft, true);
updateAxes();
}

const QwtScaleDiv & scaleDiv = axisScaleDiv(yLeft);
fixedScaleMin = scaleDiv.lowerBound();
fixedScaleMax = scaleDiv.upperBound();
fixedScale = true;
setAxisAutoScale(yLeft, false);
emit zoomChanged(fixedScaleMin, fixedScaleMax);
}
}

void TimePlot::setScaleY() {
Expand Down

0 comments on commit 53facfd

Please sign in to comment.