[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:
Ruben Dashyan
2019-03-20 11:31:33 +01:00
committed by Émilie Feral
parent 8629254d9a
commit 67f9f79322
14 changed files with 21 additions and 33 deletions

View File

@@ -208,12 +208,6 @@ void InteractiveCurveViewRange::panToMakePointVisible(float x, float y, float to
}
}
bool InteractiveCurveViewRange::isCursorVisible(float topMarginRatio, float rightMarginRatio, float bottomMarginRation, float leftMarginRation) {
float xRange = m_xMax - m_xMin;
float yRange = m_yMax - m_yMin;
return m_cursor->x() >= m_xMin + leftMarginRation*xRange && m_cursor->x() <= m_xMax - rightMarginRatio*xRange && m_cursor->y() >= m_yMin + bottomMarginRation*yRange && m_cursor->y() <= m_yMax - topMarginRatio*yRange;
}
float InteractiveCurveViewRange::clipped(float x, bool isMax) {
float maxF = isMax ? k_upperMaxFloat : k_lowerMaxFloat;
float minF = isMax ? -k_lowerMaxFloat : -k_upperMaxFloat;