mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
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:
parent
307a888c50
commit
12610de8f8
@ -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 (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;
|
initialTouchLocation = null;
|
||||||
} else {
|
} else {
|
||||||
return !allowDefaultActions;
|
return !allowDefaultActions;
|
||||||
|
@ -75,13 +75,17 @@ public class PanZoomController
|
|||||||
|
|
||||||
// Animation stops if the velocity is below this value when overscrolled or panning.
|
// Animation stops if the velocity is below this value when overscrolled or panning.
|
||||||
private static final float STOPPED_THRESHOLD = 4.0f;
|
private static final float STOPPED_THRESHOLD = 4.0f;
|
||||||
|
|
||||||
// Animation stops is the velocity is below this threshold when flinging.
|
// Animation stops is the velocity is below this threshold when flinging.
|
||||||
private static final float FLING_STOPPED_THRESHOLD = 0.1f;
|
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.
|
// The distance the user has to pan before we recognize it as such (e.g. to avoid 1-pixel pans
|
||||||
public static final float PAN_THRESHOLD = 0.1f;
|
// 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
|
// Angle from axis within which we stay axis-locked
|
||||||
private static final double AXIS_LOCK_ANGLE = Math.PI / 6.0; // 30 degrees
|
private static final double AXIS_LOCK_ANGLE = Math.PI / 6.0; // 30 degrees
|
||||||
|
|
||||||
// The maximum amount we allow you to zoom into a page
|
// The maximum amount we allow you to zoom into a page
|
||||||
private static final float MAX_ZOOM = 4.0f;
|
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);
|
Log.e(LOGTAG, "Received impossible touch move while in " + mState);
|
||||||
return false;
|
return false;
|
||||||
case TOUCHING:
|
case TOUCHING:
|
||||||
if (panDistance(event) < PAN_THRESHOLD * GeckoAppShell.getDpi()) {
|
if (panDistance(event) < PAN_THRESHOLD) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
cancelTouch();
|
cancelTouch();
|
||||||
|
Loading…
Reference in New Issue
Block a user