mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-30 04:00:02 +02:00
[apps/graph] Round x before evaluating graph cursor on scroll
Change-Id: I13500669963eb8130e188a898bed0bf63655add6
This commit is contained in:
committed by
Émilie Feral
parent
bd2609bcba
commit
9e12b61849
@@ -1,3 +1,4 @@
|
||||
#include "function_banner_delegate.h"
|
||||
#include "interactive_curve_view_controller.h"
|
||||
#include <cmath>
|
||||
#include <float.h>
|
||||
@@ -219,6 +220,10 @@ bool InteractiveCurveViewController::textFieldDidFinishEditing(TextField * textF
|
||||
if (textFieldDelegateApp()->hasUndefinedValue(text, floatBody)) {
|
||||
return false;
|
||||
}
|
||||
/* If possible, round floatBody so that we go to the evaluation of the
|
||||
* displayed floatBody */
|
||||
floatBody = FunctionBannerDelegate::getValueDisplayedOnBanner(floatBody, textFieldDelegateApp()->localContext(), curveView()->pixelWidth(), false);
|
||||
|
||||
Coordinate2D<double> xy = xyValues(selectedCurveIndex(), floatBody, textFieldDelegateApp()->localContext());
|
||||
m_cursor->moveTo(floatBody, xy.x1(), xy.x2());
|
||||
interactiveCurveViewRange()->panToMakePointVisible(m_cursor->x(), m_cursor->y(), cursorTopMarginRatio(), cursorRightMarginRatio(), cursorBottomMarginRatio(), cursorLeftMarginRatio(), curveView()->pixelWidth());
|
||||
|
||||
Reference in New Issue
Block a user