mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 16:57:31 +01:00
32 lines
500 B
C++
32 lines
500 B
C++
#include "curve_view_cursor.h"
|
|
#include <math.h>
|
|
|
|
namespace Shared {
|
|
|
|
CurveViewCursor::CurveViewCursor() :
|
|
m_x(NAN),
|
|
m_y(NAN)
|
|
{
|
|
}
|
|
|
|
float CurveViewCursor::x() {
|
|
return m_x;
|
|
}
|
|
|
|
float CurveViewCursor::y() {
|
|
return m_y;
|
|
}
|
|
|
|
void CurveViewCursor::moveTo(float x, float y) {
|
|
m_x = clipped(x);
|
|
m_y = clipped(y);
|
|
}
|
|
|
|
float CurveViewCursor::clipped(float x) {
|
|
float clippedX = x > k_maxFloat ? k_maxFloat : x;
|
|
clippedX = clippedX < - k_maxFloat ? -k_maxFloat : clippedX;
|
|
return clippedX;
|
|
}
|
|
|
|
}
|