mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-22 07:10:40 +01:00
[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user