Bug 1159985 - If only one component of a fling is in overscroll, continue the fling in the other component. r=kats

--HG--
extra : source : dd5f73b96d7de9cc16cdb498e22930aa54a8a103
This commit is contained in:
Botond Ballo 2015-05-11 22:27:48 -04:00
Родитель 0fd5163a65
Коммит 2904d8d719
2 изменённых файлов: 15 добавлений и 3 удалений

Просмотреть файл

@ -527,8 +527,6 @@ public:
// We may have reached the end of the scroll range along one axis but
// not the other. In such a case we only want to hand off the relevant
// component of the fling.
// TODO(botond): If our intention is to continue the other component
// in this APZC, we should not be returning 'false'.
if (FuzzyEqualsAdditive(overscroll.x, 0.0f, COORDINATE_EPSILON)) {
velocity.x = 0;
} else if (FuzzyEqualsAdditive(overscroll.y, 0.0f, COORDINATE_EPSILON)) {
@ -552,7 +550,11 @@ public:
velocity,
mOverscrollHandoffChain));
return false;
// If there is a remaining velocity on this APZC, continue this fling
// as well. (This fling and the handed-off fling will run concurrently.)
// Note that AdjustDisplacement() will have zeroed out the velocity
// along the axes where we're overscrolled.
return !IsZero(mApzc.GetVelocityVector());
}
return true;
@ -1865,6 +1867,11 @@ const ParentLayerPoint AsyncPanZoomController::GetVelocityVector() const {
return ParentLayerPoint(mX.GetVelocity(), mY.GetVelocity());
}
void AsyncPanZoomController::SetVelocityVector(const ParentLayerPoint& aVelocityVector) {
mX.SetVelocity(aVelocityVector.x);
mY.SetVelocity(aVelocityVector.y);
}
void AsyncPanZoomController::HandlePanningWithTouchAction(double aAngle) {
// Handling of cross sliding will need to be added in this method after touch-action released
// enabled by default.

Просмотреть файл

@ -524,6 +524,11 @@ protected:
*/
const ParentLayerPoint GetVelocityVector() const;
/**
* Sets the velocities of each axis.
*/
void SetVelocityVector(const ParentLayerPoint& aVelocityVector);
/**
* Gets the first touch point from a MultiTouchInput. This gets only
* the first one and assumes the rest are either missing or not relevant.