Bug 1661108. Only send pan events from DManip if the delta is at least 1. r=kats

This seems to match what Chrome does. On macOS we only get sent deltas from the OS that are at least 1.

Differential Revision: https://phabricator.services.mozilla.com/D88542
This commit is contained in:
Timothy Nikkel 2020-09-04 03:27:09 +00:00
parent 1bc1fa2c82
commit b5e6c5d19a

View File

@ -298,6 +298,17 @@ DManipEventHandler::OnContentUpdated(IDirectManipulationViewport* viewport,
TransitionToState(State::ePinching);
}
if (mState == State::ePanning || mState == State::eInertia) {
// Accumulate the offset (by not updating mLastX/YOffset) until we have at
// least one pixel both before and after scaling by the window scale.
float dx = std::abs(mLastXOffset - xoffset);
float dy = std::abs(mLastYOffset - yoffset);
float minDelta = std::max(1.f, windowScale);
if (dx < minDelta && dy < minDelta) {
return S_OK;
}
}
bool updateLastScale = true;
if (mState == State::ePanning) {
if (mShouldSendPanStart) {