@@ -75,9 +75,9 @@ public abstract class Chart extends BitmapCachedChart {
75
75
* @see #zoomIn()
76
76
* @see #zoomOut()
77
77
*/
78
- private static final float ZOOM_AMOUNT = 0.25f ;
78
+ private static final float ZOOM_AMOUNT = 0.2f ;
79
79
80
- private Point mSurfaceSizeBuffer = new Point ();
80
+ private final Point mSurfaceSizeBuffer = new Point ();
81
81
82
82
83
83
// Edge effect / overscroll tracking objects.
@@ -222,6 +222,7 @@ private boolean hitTest(float x, float y, PointF dest) {
222
222
if (!mContentRect .contains ((int ) x , (int ) y )) {
223
223
return false ;
224
224
}
225
+
225
226
dest .set (mCurrentViewport .left
226
227
+ mCurrentViewport .width ()
227
228
* (x - mContentRect .left ) / mContentRect .width (),
@@ -316,6 +317,7 @@ else if (zoomOut)
316
317
mCurrentViewport .constrainViewport ();
317
318
triggerViewportChange ();
318
319
lastSpanX = spanX ;
320
+
319
321
return true ;
320
322
}
321
323
};
@@ -335,6 +337,7 @@ public boolean onDown(MotionEvent e) {
335
337
releaseEdgeEffects ();
336
338
mScrollerStartViewport .set (mCurrentViewport );
337
339
mScroller .forceFinished (true );
340
+
338
341
postInvalidateOnAnimation ();
339
342
340
343
return true ;
@@ -446,6 +449,8 @@ public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float ve
446
449
};
447
450
448
451
protected void triggerViewportChange () {
452
+ postInvalidateOnAnimation ();
453
+
449
454
if (mInternalViewportChangeListener != null ) {
450
455
mInternalViewportChangeListener .onViewportChange (mCurrentViewport );
451
456
}
@@ -460,7 +465,6 @@ protected void triggerViewportChange() {
460
465
}
461
466
}
462
467
}
463
- postInvalidateOnAnimation ();
464
468
}
465
469
466
470
private void fling (int velocityX ) {
0 commit comments