diff --git a/Telegram/SourceFiles/statistics/chart_widget.cpp b/Telegram/SourceFiles/statistics/chart_widget.cpp index 7a81280a8..b28c62e5f 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 eb7962f14..12437f9bd 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;