From 77695091b31ce47c5caccfdb24b8b8bcdb901df8 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 1 Jul 2023 11:53:19 +0300 Subject: [PATCH] Slightly clarified name of y-axis animation in chart widget. --- Telegram/SourceFiles/statistics/chart_widget.cpp | 8 ++++---- Telegram/SourceFiles/statistics/chart_widget.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/statistics/chart_widget.cpp b/Telegram/SourceFiles/statistics/chart_widget.cpp index 7a81280a80..b28c62e5fe 100644 --- a/Telegram/SourceFiles/statistics/chart_widget.cpp +++ b/Telegram/SourceFiles/statistics/chart_widget.cpp @@ -281,10 +281,10 @@ void ChartWidget::ChartAnimationController::tick( constexpr auto kXExpandingDuration = 200.; constexpr auto kAlphaExpandingDuration = 200.; - if (!_yAnimationStartedAt + if (!_heightAnimationStarted && ((now - _lastUserInteracted) >= kExpandingDelay)) { _heightAnimationStarts.fire({}); - _yAnimationStartedAt = _lastUserInteracted + kExpandingDelay; + _heightAnimationStarted = true; } if (!_alphaAnimationStartedAt) { _alphaAnimationStartedAt = now; @@ -324,7 +324,7 @@ void ChartWidget::ChartAnimationController::tick( _animValueXMin.update(dtX, anim::linear); _animValueXMax.update(dtX, anim::linear); } - if (_yAnimationStartedAt) { + if (_heightAnimationStarted) { _animValueYMin.update(_dtCurrent.min, anim::easeInCubic); _animValueYMax.update(_dtCurrent.max, anim::easeInCubic); _animValueYAlpha.update(dtAlpha, anim::easeInCubic); @@ -357,7 +357,7 @@ void ChartWidget::ChartAnimationController::tick( if (yFinished && alphaFinished) { _alphaAnimationStartedAt = 0; - _yAnimationStartedAt = 0; + _heightAnimationStarted = false; } } diff --git a/Telegram/SourceFiles/statistics/chart_widget.h b/Telegram/SourceFiles/statistics/chart_widget.h index eb7962f144..12437f9bd6 100644 --- a/Telegram/SourceFiles/statistics/chart_widget.h +++ b/Telegram/SourceFiles/statistics/chart_widget.h @@ -54,8 +54,8 @@ private: Ui::Animations::Basic _animation; crl::time _lastUserInteracted = 0; - crl::time _yAnimationStartedAt = 0; crl::time _alphaAnimationStartedAt = 0; + bool _heightAnimationStarted = false; anim::value _animValueXMin; anim::value _animValueXMax;