Bug 706891 part 2 - Reduce PAN_THRESHOLD from 1/10" to 1/16" and change units to dps. r=kats

This commit is contained in:
Chris Peterson 2012-02-14 11:43:45 -08:00
parent 307a888c50
commit 12610de8f8
2 changed files with 10 additions and 5 deletions

View File

@ -393,8 +393,9 @@ public class LayerController {
});
}
// After the initial touch, ignore touch moves until they exceed a minimum distance.
if (initialTouchLocation != null && (action & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_MOVE) {
if (PointUtils.subtract(point, initialTouchLocation).length() > PanZoomController.PAN_THRESHOLD * 240) {
if (PointUtils.subtract(point, initialTouchLocation).length() > PanZoomController.PAN_THRESHOLD) {
initialTouchLocation = null;
} else {
return !allowDefaultActions;

View File

@ -75,13 +75,17 @@ public class PanZoomController
// Animation stops if the velocity is below this value when overscrolled or panning.
private static final float STOPPED_THRESHOLD = 4.0f;
// Animation stops is the velocity is below this threshold when flinging.
private static final float FLING_STOPPED_THRESHOLD = 0.1f;
// The distance the user has to pan before we recognize it as such (e.g. to avoid
// 1-pixel pans between the touch-down and touch-up of a click). In units of inches.
public static final float PAN_THRESHOLD = 0.1f;
// The distance the user has to pan before we recognize it as such (e.g. to avoid 1-pixel pans
// between the touch-down and touch-up of a click). In units of density-independent pixels.
public static final float PAN_THRESHOLD = 1/16f * GeckoAppShell.getDpi();
// Angle from axis within which we stay axis-locked
private static final double AXIS_LOCK_ANGLE = Math.PI / 6.0; // 30 degrees
// The maximum amount we allow you to zoom into a page
private static final float MAX_ZOOM = 4.0f;
@ -288,7 +292,7 @@ public class PanZoomController
Log.e(LOGTAG, "Received impossible touch move while in " + mState);
return false;
case TOUCHING:
if (panDistance(event) < PAN_THRESHOLD * GeckoAppShell.getDpi()) {
if (panDistance(event) < PAN_THRESHOLD) {
return false;
}
cancelTouch();