2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Reduced redundant calculations of animation in chart widget.

This commit is contained in:
23rd
2023-07-01 12:18:33 +03:00
committed by John Preston
parent 77695091b3
commit d603f4de51
2 changed files with 79 additions and 87 deletions

View File

@@ -57,16 +57,16 @@ private:
crl::time _alphaAnimationStartedAt = 0;
bool _heightAnimationStarted = false;
anim::value _animValueXMin;
anim::value _animValueXMax;
anim::value _animValueYMin;
anim::value _animValueYMax;
anim::value _animationValueXMin;
anim::value _animationValueXMax;
anim::value _animationValueHeightMin;
anim::value _animationValueHeightMax;
anim::value _animValueYAlpha;
Limits _finalHeightLimits;
float _dtYSpeed = 0.;
float _dtHeightSpeed = 0.;
Limits _dtCurrent;
rpl::event_stream<> _heightAnimationStarts;
@@ -78,40 +78,11 @@ private:
bool _useMinHeight = false;
Limits _currentHeight;
Limits _animateToHeight;
Limits _thresholdHeight = { -1, 0 };
Limits _startFrom;
Limits _startFromH;
Limits _xPercentageLimits;
// struct {
// Ui::Animations::Basic animation;
// crl::time lastUserInteracted = 0;
// crl::time yAnimationStartedAt = 0;
// crl::time alphaAnimationStartedAt = 0;
// anim::value animValueXMin;
// anim::value animValueXMax;
// anim::value animValueYMin;
// anim::value animValueYMax;
// anim::value animValueYAlpha;
// float dtYSpeed = 0.;
// Limits dtCurrent;
// } _xPercentage;
ChartAnimationController _animationController;
float64 _minMaxUpdateStep = 0.;
crl::time _lastHeightLimitsChanged = 0;
std::vector<ChartHorizontalLinesData> _horizontalLines;
Ui::Animations::Simple _heightLimitsAnimation;
};
} // namespace Statistic