From d3a2c40f52a90d50698b13d07edb23b6f863835c Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Thu, 21 Oct 2021 22:33:54 +0200 Subject: [PATCH] profile: remove "changed" flag of DiveCartesianAxis This prevented the axes from being redrawn on resize. It shouldn't be necessary anymore. Signed-off-by: Berthold Stoeger --- profile-widget/divecartesianaxis.cpp | 8 -------- profile-widget/divecartesianaxis.h | 1 - 2 files changed, 9 deletions(-) diff --git a/profile-widget/divecartesianaxis.cpp b/profile-widget/divecartesianaxis.cpp index 82eb03c1c..5de4a3d49 100644 --- a/profile-widget/divecartesianaxis.cpp +++ b/profile-widget/divecartesianaxis.cpp @@ -13,7 +13,6 @@ static const double labelSpaceVertical = 2.0; // space between label and ticks void DiveCartesianAxis::setBounds(double minimum, double maximum) { - changed = !IS_FP_SAME(max, maximum) || !IS_FP_SAME(min, minimum); dataMin = min = minimum; dataMax = max = maximum; } @@ -32,7 +31,6 @@ DiveCartesianAxis::DiveCartesianAxis(Position position, bool inverted, int integ textVisibility(textVisible), lineVisibility(linesVisible), labelScale(labelScale), - changed(true), dpr(dpr), transform({1.0, 0.0}) { @@ -77,7 +75,6 @@ void DiveCartesianAxis::setTransform(double a, double b) { transform.a = a; transform.b = b; - changed = true; } template @@ -135,9 +132,6 @@ static double sensibleInterval(double inc, int decimals) void DiveCartesianAxis::updateTicks(int animSpeed) { - if (!changed && !printMode) - return; - if (dataMax - dataMin < 1e-5) return; @@ -206,7 +200,6 @@ void DiveCartesianAxis::updateTicks(int animSpeed) updateLabels(numTicks, firstPosScreen, firstValue, stepScreen, stepValue, animSpeed); if (lineVisibility) updateLines(numTicks, firstPosScreen, stepScreen, animSpeed); - changed = false; } void DiveCartesianAxis::updateLabels(int numTicks, double firstPosScreen, double firstValue, double stepScreen, double stepValue, int animSpeed) @@ -316,7 +309,6 @@ void DiveCartesianAxis::setPosition(const QRectF &rectIn) setLine(QLineF(rect.bottomLeft(), rect.bottomRight())); break; } - changed = true; } double DiveCartesianAxis::Transform::to(double x) const diff --git a/profile-widget/divecartesianaxis.h b/profile-widget/divecartesianaxis.h index b4297c559..c77e8b9c6 100644 --- a/profile-widget/divecartesianaxis.h +++ b/profile-widget/divecartesianaxis.h @@ -64,7 +64,6 @@ private: bool textVisibility; bool lineVisibility; double labelScale; - bool changed; double dpr; double labelWidth, labelHeight; // maximum expected sizes of label width and height