[apps/graph] Move nextRootFrom from the controller to the model

CartesianFunction and take into account function domain
This commit is contained in:
Émilie Feral
2019-09-09 10:44:30 +02:00
parent aa45adb49a
commit 901cce9e67
3 changed files with 21 additions and 5 deletions

View File

@@ -17,11 +17,7 @@ const char * RootGraphController::title() {
}
Coordinate2D<double> RootGraphController::computeNewPointOfInterest(double start, double step, double max, Context * context) {
// TODO The following three lines should be factored.
constexpr int bufferSize = CodePoint::MaxCodePointCharLength + 1;
char unknownX[bufferSize];
Poincare::SerializationHelper::CodePoint(unknownX, bufferSize, UCodePointUnknownX);
return Coordinate2D<double>(Shared::PoincareHelpers::NextRoot(functionStore()->modelForRecord(m_record)->expressionReduced(context), unknownX, start, step, max, context), 0.0);
return functionStore()->modelForRecord(m_record)->nextRootFrom(start, step, max, context);
}
}