[apps/regression] Prediction knowing y: if the value has multiple

antecedent (horizontal slope) reselect last cursor position

Change-Id: I730819c1c0ef5cbe0b3234368185dc7e56a74955
This commit is contained in:
Émilie Feral
2017-04-17 17:37:49 +02:00
parent 752fc8607d
commit 0072b04427

View File

@@ -1,6 +1,7 @@
#include "go_to_parameter_controller.h"
#include "../apps_container.h"
#include <assert.h>
#include <float.h>
using namespace Shared;
using namespace Poincare;
@@ -48,6 +49,10 @@ bool GoToParameterController::setParameterAtIndex(int parameterIndex, float f) {
return false;
}
if (isnan(x)) {
if (m_store->slope() < FLT_EPSILON && f == 0.0f) {
m_cursor->moveTo(m_cursor->x(), f);
return true;
}
app()->displayWarning(I18n::Message::ValueNotReachedByRegression);
return false;
}