Bug 769391 - Prevent axis locking when on a page that fits the user's screen vertically or horizontally. r=kats

This commit is contained in:
AlexHagerman 2012-09-17 10:55:58 -04:00
parent 8a7e8c754a
commit d9cfff8b87
2 changed files with 4 additions and 2 deletions

View File

@ -212,7 +212,7 @@ abstract class Axis {
* Returns true if the page is zoomed in to some degree along this axis such that scrolling is
* possible and this axis has not been scroll locked while panning. Otherwise, returns false.
*/
private boolean scrollable() {
boolean scrollable() {
// If we're scrolling a subdocument, ignore the viewport length restrictions (since those
// apply to the top-level document) and only take into account axis locking.
if (mSubscroller.scrolling()) {

View File

@ -493,7 +493,9 @@ public class PanZoomController
mY.startTouch(y);
mLastEventTime = time;
if (angle < AXIS_LOCK_ANGLE || angle > (Math.PI - AXIS_LOCK_ANGLE)) {
if (!mX.scrollable() || !mY.scrollable()) {
setState(PanZoomState.PANNING);
} else if (angle < AXIS_LOCK_ANGLE || angle > (Math.PI - AXIS_LOCK_ANGLE)) {
mY.setScrollingDisabled(true);
setState(PanZoomState.PANNING_LOCKED);
} else if (Math.abs(angle - (Math.PI / 2)) < AXIS_LOCK_ANGLE) {