[apps/shared] CurveViewCursor: cursor.m_x can reach infinity by t can't

and can't be undefined either
This commit is contained in:
Émilie Feral
2019-09-05 14:21:27 +02:00
parent 71e66ad513
commit e55541ae82

View File

@@ -1,4 +1,5 @@
#include "curve_view_cursor.h"
#include <assert.h>
#include <cmath>
namespace Shared {
@@ -6,8 +7,9 @@ namespace Shared {
CurveViewCursor::CurveViewCursor() : m_t(NAN), m_x(NAN), m_y(NAN) {}
void CurveViewCursor::moveTo(double t, double x, double y) {
assert(!std::isnan(t));
m_t = clipped(t, false);
m_x = clipped(x, false); //TODO LEA ?
m_x = clipped(x, true);
m_y = clipped(y, true);
}