Skip to content

Commit 2719cef

Browse files
committed
Fixed longpress-drag issue.
1 parent 3c5523b commit 2719cef

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

1 Byte
Binary file not shown.

MPChartLib/src/com/github/mikephil/charting/listener/BarLineChartTouchListener.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public boolean onTouch(View v, MotionEvent event) {
119119
}
120120

121121
// determine the touch-pointer center
122-
midPoint(mTouchPointCenter, event);
122+
midPoint(mTouchPointCenter, event);
123123
}
124124
break;
125125
case MotionEvent.ACTION_MOVE:
@@ -138,7 +138,7 @@ public boolean onTouch(View v, MotionEvent event) {
138138

139139
} else if (mTouchMode == NONE
140140
&& Math.abs(distance(event.getX(), mTouchStartPoint.x, event.getY(),
141-
mTouchStartPoint.y)) > 5f) {
141+
mTouchStartPoint.y)) > 25f) {
142142

143143
if (mChart.hasNoDragOffset()) {
144144

@@ -399,7 +399,7 @@ public void onLongPress(MotionEvent e) {
399399
if (l != null) {
400400

401401
l.onChartLongPressed(e);
402-
} else {
402+
} else if(mTouchMode == NONE) {
403403

404404
mChart.fitScreen();
405405

0 commit comments

Comments
 (0)