From e7958b8287806af2d3ab5719a3febdc4c3b79e8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Tue, 3 Sep 2019 15:27:33 +0200 Subject: [PATCH] [apps/graph] Fix yAuto for cartesian functions Scenario: display f(x) = x --- apps/shared/cartesian_function.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/shared/cartesian_function.h b/apps/shared/cartesian_function.h index b6321682c..28ad70d5a 100644 --- a/apps/shared/cartesian_function.h +++ b/apps/shared/cartesian_function.h @@ -51,7 +51,7 @@ public: double tMax() const override; void setTMin(double tMin); void setTMax(double tMax); - float rangeStep() const override { return (tMax() - tMin())/k_polarParamRangeSearchNumberOfPoints; } + float rangeStep() const override { return plotType() == PlotType::Cartesian ? NAN : (tMax() - tMin())/k_polarParamRangeSearchNumberOfPoints; } private: constexpr static float k_polarParamRangeSearchNumberOfPoints = 100.0f; // This is ad hoc, no special justification