mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps] Implement InteractiveCurveViewController::isCursorVisible
It was a pure virtual method implemented in derived classes Shared::FunctionGraphController, Regression::GraphController. InteractiveCurveViewRange does not need anymore to hold CurveViewCursor * m_cursor.
This commit is contained in:
committed by
Émilie Feral
parent
8629254d9a
commit
67f9f79322
@@ -194,6 +194,17 @@ StackViewController * InteractiveCurveViewController::stackController() const{
|
||||
return (StackViewController *)(parentResponder()->parentResponder()->parentResponder());
|
||||
}
|
||||
|
||||
bool InteractiveCurveViewController::isCursorVisible() {
|
||||
InteractiveCurveViewRange * range = interactiveCurveViewRange();
|
||||
float xRange = range->xMax() - range->xMin();
|
||||
float yRange = range->yMax() - range->yMin();
|
||||
return
|
||||
m_cursor->x() >= range->xMin() + k_cursorLeftMarginRatio * xRange &&
|
||||
m_cursor->x() <= range->xMax() - k_cursorRightMarginRatio * xRange &&
|
||||
m_cursor->y() >= range->yMin() + cursorBottomMarginRatio() * yRange &&
|
||||
m_cursor->y() <= range->yMax() - cursorTopMarginRatio() * yRange;
|
||||
}
|
||||
|
||||
int InteractiveCurveViewController::closestCurveIndexVertically(bool goingUp, int currentCurveIndex, Poincare::Context * context) const {
|
||||
double x = m_cursor->x();
|
||||
double y = m_cursor->y();
|
||||
|
||||
Reference in New Issue
Block a user