mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/shared] Allow movement from undef curve
Fix a bug preventing the cursor from moving to other curves using UP and DOWN when the y value was undef. To reproduce : - In Graph, define f(x) = 1 and g(x) = ln(x), then draw the curves - Press DOWN to select g - Press LEFT until g is not defined anymore --> Pressing UP or DOWN won't allow you to select f Change-Id: I79ed4a57b78ac0b8dac3f66e722e358bd4be18d9
This commit is contained in:
committed by
Émilie Feral
parent
c130f8e881
commit
26bbdead7d
@@ -261,6 +261,9 @@ bool InteractiveCurveViewController::isCursorVisible() {
|
||||
int InteractiveCurveViewController::closestCurveIndexVertically(bool goingUp, int currentCurveIndex, Poincare::Context * context) const {
|
||||
double x = m_cursor->x();
|
||||
double y = m_cursor->y();
|
||||
if (std::isnan(y)) {
|
||||
y = goingUp ? -INFINITY : INFINITY;
|
||||
}
|
||||
double nextY = goingUp ? DBL_MAX : -DBL_MAX;
|
||||
int nextCurveIndex = -1;
|
||||
int curvesCount = numberOfCurves();
|
||||
|
||||
Reference in New Issue
Block a user