[apps/statistics] Update and replace comment

This commit is contained in:
Hugo Saint-Vignes
2021-01-05 16:41:53 +01:00
committed by LeaNumworks
parent 83722342f7
commit 5e7d93b331
2 changed files with 8 additions and 10 deletions

View File

@@ -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();
}

View File

@@ -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);