From adf28345b1389d15a9527359fce380eddec5aeac Mon Sep 17 00:00:00 2001 From: Gabriel Ozouf Date: Fri, 13 Nov 2020 10:36:02 +0100 Subject: [PATCH] [poincare/zoom] Reduce zoom artifact Do not use the bounds of the interval when computing a refined range. As the bounds are often integers, the zoom would give strange result on some non-continuous functions (e.g. f(x) = x!). Change-Id: Ie127fe15191cb3951cff223adc8dc3172188c789 --- poincare/src/zoom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poincare/src/zoom.cpp b/poincare/src/zoom.cpp index 5569c9ec2..eb8a91428 100644 --- a/poincare/src/zoom.cpp +++ b/poincare/src/zoom.cpp @@ -183,7 +183,7 @@ void Zoom::RefinedYRangeForDisplay(ValueAtAbscissa evaluation, float xMin, float float sum = 0.f; int pop = 0; - for (int i = 1; i < sampleSize; i++) { + for (int i = 1; i < sampleSize - 1; i++) { x = xMin + i * step; y = evaluation(x, context, auxiliary); if (!std::isfinite(y)) {