INNER CODE UNIT · Java
onMove
jjoe64/GraphView · src/main/java/com/jjoe64/graphview/CursorMode.java:103
public void onMove(MotionEvent e) {
if (mCursorVisible) {
mPosX = Math.max(e.getX(), mGraphView.getGraphContentLeft());
mPosX = Math.min(mPosX, mGraphView.getGraphContentLeft() + mGraphView.getGraphContentWidth());
mPosY = e.getY();
findCurrentDataPoint();
mGraphView.invalidate();
}
}
public void draw(Canvas canvas) {
if (mCursorVisible) {
canvas.drawLine(mPosX, 0, mPosX, canvas.getHeight(), mPaintLine);
}
// selection
for (Map.Entry<BaseSeries, DataPointInterface> entry : mCurrentSelection.entrySet()) {
entry.getKey().drawSelection(mGraphView, canvas, false, entry.getValue());