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

Removed some duplicated code from chart line view context.

This commit is contained in:
23rd
2023-07-27 01:10:24 +03:00
committed by John Preston
parent 1209bd35c5
commit 788a81df6c
6 changed files with 13 additions and 195 deletions

View File

@@ -950,7 +950,7 @@ void ChartWidget::setupChartArea() {
// !_animationController.isFPSSlow()
// || !_animationController.animating());
PainterHighQualityEnabler hp(p);
_linearChartPainter.main->paint(
_linearChartView.main->paint(
p,
_chartData,
_animationController.currentXIndices(),
@@ -1075,8 +1075,7 @@ void ChartWidget::setupFooter() {
// !_animationController.isFPSSlow()
// || !_animationController.animating());
PainterHighQualityEnabler hp(p);
_animatedChartLines.setCacheFooter(true);
_linearChartPainter.footer->paint(
_linearChartView.footer->paint(
p,
_chartData,
{ 0., float64(_chartData.x.size() - 1) },
@@ -1085,7 +1084,6 @@ void ChartWidget::setupFooter() {
r,
_animatedChartLines,
detailsPaintContext);
_animatedChartLines.setCacheFooter(false);
}
});
@@ -1254,8 +1252,8 @@ void ChartWidget::setupFilterButtons() {
void ChartWidget::setChartData(Data::StatisticalChart chartData) {
_chartData = std::move(chartData);
_linearChartPainter.main = std::make_unique<LinearChartPainter>();
_linearChartPainter.footer = std::make_unique<LinearChartPainter>();
_linearChartView.main = std::make_unique<LinearChartView>();
_linearChartView.footer = std::make_unique<LinearChartView>();
setupDetails();
setupFilterButtons();