mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
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:
parent
1bc1fa2c82
commit
b5e6c5d19a
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user