[apps] Tweaked panning for better cache alignement

Method InteractiveCurveViewRange::panToMakePointVisible now moves the
range of a whole number of pixels when panning horizontally. This allows
the cache of cartesian functions not to be invalidated.

Change-Id: Idb9904fef134dd13458e1f2287b0fe5145e8aec7
This commit is contained in:
Gabriel Ozouf
2020-06-09 13:38:24 +02:00
committed by Émilie Feral
parent 5bc19af196
commit 4007f4d452
10 changed files with 20 additions and 15 deletions

View File

@@ -26,7 +26,7 @@ SumGraphController::SumGraphController(Responder * parentResponder, InputEventHa
void SumGraphController::viewWillAppear() {
SimpleInteractiveCurveViewController::viewWillAppear();
m_graphRange->panToMakePointVisible(m_cursor->x(), m_cursor->y(), cursorTopMarginRatio(), k_cursorRightMarginRatio, cursorBottomMarginRatio(), k_cursorLeftMarginRatio);
m_graphRange->panToMakePointVisible(m_cursor->x(), m_cursor->y(), cursorTopMarginRatio(), k_cursorRightMarginRatio, cursorBottomMarginRatio(), k_cursorLeftMarginRatio, curveView()->pixelWidth());
m_graphView->setBannerView(&m_legendView);
m_graphView->setCursorView(&m_cursorView);
m_graphView->setOkView(nullptr);
@@ -77,7 +77,7 @@ bool SumGraphController::moveCursorHorizontallyToPosition(double x) {
m_graphView->setAreaHighlight(m_startSum, m_cursor->x());
}
m_legendView.setEditableZone(m_cursor->x());
m_graphRange->panToMakePointVisible(x, y, cursorTopMarginRatio(), k_cursorRightMarginRatio, cursorBottomMarginRatio(), k_cursorLeftMarginRatio);
m_graphRange->panToMakePointVisible(x, y, cursorTopMarginRatio(), k_cursorRightMarginRatio, cursorBottomMarginRatio(), k_cursorLeftMarginRatio, curveView()->pixelWidth());
m_graphView->reload();
return true;
}