mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 719320 part.8-11 Cancel applying delta multipliers from overflowDelta r=smaug
This commit is contained in:
parent
649734f593
commit
f666bb683a
@ -2814,6 +2814,7 @@ nsEventStateManager::DoScrollText(nsIScrollableFrame* aScrollableFrame,
|
||||
|
||||
aEvent->overflowDeltaX = aEvent->deltaX;
|
||||
aEvent->overflowDeltaY = aEvent->deltaY;
|
||||
WheelPrefs::GetInstance()->CancelApplyingUserPrefsFromOverflowDelta(aEvent);
|
||||
|
||||
nsIFrame* scrollFrame = do_QueryFrame(aScrollableFrame);
|
||||
MOZ_ASSERT(scrollFrame);
|
||||
@ -2938,6 +2939,7 @@ nsEventStateManager::DoScrollText(nsIScrollableFrame* aScrollableFrame,
|
||||
aEvent->overflowDeltaY =
|
||||
static_cast<double>(overflow.y) / scrollAmountInDevPixels.height;
|
||||
}
|
||||
WheelPrefs::GetInstance()->CancelApplyingUserPrefsFromOverflowDelta(aEvent);
|
||||
}
|
||||
|
||||
void
|
||||
@ -5357,6 +5359,19 @@ nsEventStateManager::WheelPrefs::ApplyUserPrefsToDelta(
|
||||
(mMultiplierZ[index] != 1.0));
|
||||
}
|
||||
|
||||
void
|
||||
nsEventStateManager::WheelPrefs::CancelApplyingUserPrefsFromOverflowDelta(
|
||||
widget::WheelEvent* aEvent)
|
||||
{
|
||||
Index index = GetIndexFor(aEvent);
|
||||
Init(index);
|
||||
|
||||
NS_ASSERTION(mMultiplierX[index] && mMultiplierY[index],
|
||||
"The absolute values of both multipliers must be 1 or larger");
|
||||
aEvent->overflowDeltaX /= mMultiplierX[index];
|
||||
aEvent->overflowDeltaY /= mMultiplierY[index];
|
||||
}
|
||||
|
||||
nsEventStateManager::WheelPrefs::Action
|
||||
nsEventStateManager::WheelPrefs::ComputeActionFor(widget::WheelEvent* aEvent)
|
||||
{
|
||||
|
@ -338,6 +338,14 @@ protected:
|
||||
*/
|
||||
void ApplyUserPrefsToDelta(mozilla::widget::WheelEvent* aEvent);
|
||||
|
||||
/**
|
||||
* If ApplyUserPrefsToDelta() changed the delta values with customized
|
||||
* prefs, the overflowDelta values would be inflated.
|
||||
* CancelApplyingUserPrefsFromOverflowDelta() cancels the inflation.
|
||||
*/
|
||||
void CancelApplyingUserPrefsFromOverflowDelta(
|
||||
mozilla::widget::WheelEvent* aEvent);
|
||||
|
||||
/**
|
||||
* Computes the default action for the aEvent with the prefs.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user