From 5e7d93b3312b25e9f1de14499f455199da06ee2f Mon Sep 17 00:00:00 2001 From: Hugo Saint-Vignes Date: Tue, 5 Jan 2021 16:41:53 +0100 Subject: [PATCH] [apps/statistics] Update and replace comment --- apps/statistics/histogram_controller.cpp | 10 ++++++++-- apps/statistics/histogram_view.cpp | 8 -------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/apps/statistics/histogram_controller.cpp b/apps/statistics/histogram_controller.cpp index 55c839c16..79f524a27 100644 --- a/apps/statistics/histogram_controller.cpp +++ b/apps/statistics/histogram_controller.cpp @@ -27,8 +27,14 @@ HistogramController::HistogramController(Responder * parentResponder, InputEvent void HistogramController::setCurrentDrawnSeries(int series) { initYRangeParameters(series); - /* The range of it CurveView has changed, the CurveView must be reloaded. - * See comment in HistogramView::drawRect. */ + /* The histogram's CurveView range has been updated along the Vertical axis. + * To call drawLabelsAndGraduations (in HistogramView::drawRect()), the + * CurveView must be reloaded so that labels and their values match the new + * range. + * In this situation, we update CurveView's Vertical axis, and draw horizontal + * labels, which are independent. To avoid having to call CurveView::reload(), + * axis could be taken into account when checking if labels are up to date, + * instead of using rangeChecksum(), which mixes all axis. */ m_view.dataViewAtIndex(series)->CurveView::reload(); } diff --git a/apps/statistics/histogram_view.cpp b/apps/statistics/histogram_view.cpp index 4166f1ab6..9b1d028f4 100644 --- a/apps/statistics/histogram_view.cpp +++ b/apps/statistics/histogram_view.cpp @@ -38,14 +38,6 @@ void HistogramView::reloadSelectedBar() { } void HistogramView::drawRect(KDContext * ctx, KDRect rect) const { - /* When setting the current drawn series, the histogram's CurveView range is - * updated along the Vertical axis. To call drawLabelsAndGraduations, - * CurveView must be reloaded (in setCurrentDrawnSeries method) so that labels - * and their values match the new range. - * In this situation, we update CurveView's Vertical axis, and draw horizontal - * labels, which are independent. To avoid having to call CurveView::reload(), - * axis could be taken into account when checking if labels are up to date, - * instead of using rangeChecksum(), which mixes all axis. */ m_controller->setCurrentDrawnSeries(m_series); ctx->fillRect(rect, KDColorWhite); drawAxis(ctx, rect, Axis::Horizontal);