From 53facfd22f8b468ae237b8b5170ad068f8599fe1 Mon Sep 17 00:00:00 2001 From: Ivan Novikov Date: Sun, 20 Jul 2014 16:51:03 +0400 Subject: [PATCH] Change 'fix now' semantic when already fixed scale Now it changes to auto scale and then fixes it. Otherwise this button is meaningless in 'fixed' mode --- src/gui/timeplot.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/timeplot.cpp b/src/gui/timeplot.cpp index 5009c50..807b354 100644 --- a/src/gui/timeplot.cpp +++ b/src/gui/timeplot.cpp @@ -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() {