Tried to fix animation bug when mouse drag is really fast.

This commit is contained in:
23rd 2023-07-01 01:05:22 +03:00 committed by John Preston
parent cd4654dfd2
commit 15698fd6f0
1 changed files with 4 additions and 1 deletions

View File

@ -293,7 +293,10 @@ ChartWidget::ChartWidget(not_null<Ui::RpWidget*> parent)
&& AnimFinished(_xPercentage.animValueYMax);
const auto alphaFinished = AnimFinished(_xPercentage.animValueYAlpha);
if (xFinished && yFinished && alphaFinished) {
_xPercentage.animation.stop();
if ((_horizontalLines.back().lines.front().absoluteValue == _xPercentage.animValueYMin.to())
&& (_horizontalLines.back().lines.back().absoluteValue == _xPercentage.animValueYMax.to())) {
_xPercentage.animation.stop();
}
_xPercentage.alphaAnimationStartedAt = 0;
_xPercentage.yAnimationStartedAt = 0;
}