[apps] GoToParameterController: remove ForbiddenValue warnings

when the controller tries to move the cursor beyond the limit of 1E8.
This commit is contained in:
Ruben Dashyan
2019-03-15 10:56:54 +01:00
committed by Émilie Feral
parent 82685cb371
commit 696434d38a
3 changed files with 2 additions and 21 deletions

View File

@@ -25,14 +25,6 @@ bool FunctionGoToParameterController::setParameterAtIndex(int parameterIndex, do
FunctionApp * myApp = (FunctionApp *)app();
ExpiringPointer<Function> function = myApp->functionStore()->modelForRecord(m_record);
float y = function->evaluateAtAbscissa(f, myApp->localContext());
if (std::fabs(f) > k_maxDisplayableFloat || std::fabs(y) > k_maxDisplayableFloat) {
app()->displayWarning(I18n::Message::ForbiddenValue);
return false;
}
if (std::isnan(y) || std::isinf(y)) {
app()->displayWarning(I18n::Message::ValueNotReachedByFunction);
return false;
}
m_cursor->moveTo(f, y);
m_graphRange->centerAxisAround(CurveViewRange::Axis::X, m_cursor->x());
m_graphRange->centerAxisAround(CurveViewRange::Axis::Y, m_cursor->y());