[apps] Factorize SimpleInteractiveCurveView::moveCursorHorizontally

This commit is contained in:
Ruben Dashyan
2019-03-20 12:06:40 +01:00
committed by Émilie Feral
parent 67f9f79322
commit f6ceae3b8b
8 changed files with 8 additions and 10 deletions

View File

@@ -39,6 +39,10 @@ bool SimpleInteractiveCurveViewController::handleZoom(Ion::Events::Event event)
bool SimpleInteractiveCurveViewController::handleLeftRightEvent(Ion::Events::Event event) {
int direction = event == Ion::Events::Left ? -1 : 1;
if (moveCursorHorizontally(direction)) {
interactiveCurveViewRange()->panToMakePointVisible(
m_cursor->x(), m_cursor->y(),
cursorTopMarginRatio(), k_cursorRightMarginRatio, cursorBottomMarginRatio(), k_cursorLeftMarginRatio
);
reloadBannerView();
curveView()->reload();
return true;