[shared] StorageCartesianFunction: fix nextIntersection to avoid taking

2 function pointers (indeed, 2 functions pointers can not live at the
same time. They are soon to be ExpiringPointer)
This commit is contained in:
Émilie Feral
2018-10-23 17:19:06 +02:00
parent c551bd89ab
commit 344351f5c2
3 changed files with 5 additions and 5 deletions

View File

@@ -41,8 +41,8 @@ Poincare::Expression::Coordinate2D IntersectionGraphController::computeNewPointO
for (int i = 0; i < functionStore()->numberOfActiveFunctions(); i++) {
Ion::Storage::Record record = functionStore()->activeRecordAtIndex(i);
if (record != m_record) {
StorageCartesianFunction * f = functionStore()->modelForRecord(record);
Poincare::Expression::Coordinate2D intersection = f->nextIntersectionFrom(start, step, max, context, f);
Poincare::Expression e = functionStore()->modelForRecord(record)->expression(context);
Poincare::Expression::Coordinate2D intersection = functionStore()->modelForRecord(m_record)->nextIntersectionFrom(start, step, max, context, e);
if ((std::isnan(result.abscissa) || std::fabs(intersection.abscissa-start) < std::fabs(result.abscissa-start)) && !std::isnan(intersection.abscissa)) {
m_intersectedRecord = record;
result = (std::isnan(result.abscissa) || std::fabs(intersection.abscissa-start) < std::fabs(result.abscissa-start)) ? intersection : result;