From a41860276372e05fdc841b9401663ed4c2632fb3 Mon Sep 17 00:00:00 2001 From: Gabriel Ozouf Date: Thu, 19 Nov 2020 11:31:41 +0100 Subject: [PATCH] [poincare/zoom] Remember points of interest when refining Change-Id: I229cbffa2577d23bfa0a4c0632bc9ec32ae338e7 --- poincare/src/zoom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poincare/src/zoom.cpp b/poincare/src/zoom.cpp index 2b5ed19a1..5569c9ec2 100644 --- a/poincare/src/zoom.cpp +++ b/poincare/src/zoom.cpp @@ -208,8 +208,8 @@ void Zoom::RefinedYRangeForDisplay(ValueAtAbscissa evaluation, float xMin, float float bound = std::exp(sum / pop + 1.f); sampleYMin = std::max(sampleYMin, - bound); sampleYMax = std::min(sampleYMax, bound); - *yMin = sampleYMin; - *yMax = sampleYMax; + *yMin = std::min(*yMin, sampleYMin); + *yMax = std::max(*yMax, sampleYMax); } /* Round out the smallest bound to 0 if it is negligible compare to the * other one. This way, we can display the X axis for positive functions such