From d171c2a2be44b7784612c7cede04df85c3504c49 Mon Sep 17 00:00:00 2001 From: Ruben Dashyan Date: Fri, 19 Jul 2019 14:51:52 +0200 Subject: [PATCH] [apps/shared/function_graph_controller] Comment about the sampling step in computeYRange --- apps/shared/function_graph_controller.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/shared/function_graph_controller.cpp b/apps/shared/function_graph_controller.cpp index a283df970..14bd3473e 100644 --- a/apps/shared/function_graph_controller.cpp +++ b/apps/shared/function_graph_controller.cpp @@ -84,6 +84,9 @@ InteractiveCurveViewRangeDelegate::Range FunctionGraphController::computeYRange( range.max = xMax; return range; } + /* In practice, a step smaller than a pixel's width is needed for sampling + * the values of a function. Otherwise some relevant extremal values may be + * missed. */ const float step = curveView()->pixelWidth() / 2; for (int i=0; inumberOfActiveFunctions(); i++) { ExpiringPointer f = functionStore()->modelForRecord(functionStore()->activeRecordAtIndex(i));