mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1235994 - Extract a helper function to request a snap to the predicted destination. r=botond
This commit is contained in:
parent
9286d4705f
commit
bbeb5a72e5
@ -2429,6 +2429,14 @@ void AsyncPanZoomController::AcceptFling(FlingHandoffState& aHandoffState) {
|
||||
aHandoffState.mChain,
|
||||
!aHandoffState.mIsHandoff, // only apply acceleration if this is an initial fling
|
||||
aHandoffState.mScrolledApzc);
|
||||
RequestSnapToDestination();
|
||||
StartAnimation(fling);
|
||||
}
|
||||
|
||||
void
|
||||
AsyncPanZoomController::RequestSnapToDestination()
|
||||
{
|
||||
ReentrantMonitorAutoEnter lock(mMonitor);
|
||||
|
||||
float friction = gfxPrefs::APZFlingFriction();
|
||||
ParentLayerPoint velocity(mX.GetVelocity(), mY.GetVelocity());
|
||||
@ -2462,8 +2470,6 @@ void AsyncPanZoomController::AcceptFling(FlingHandoffState& aHandoffState) {
|
||||
predictedDestination);
|
||||
}
|
||||
}
|
||||
|
||||
StartAnimation(fling);
|
||||
}
|
||||
|
||||
bool AsyncPanZoomController::AttemptFling(FlingHandoffState& aHandoffState) {
|
||||
|
@ -640,6 +640,9 @@ protected:
|
||||
// to a nearby snap position if appropriate. The current scroll position is
|
||||
// used as the final destination.
|
||||
void RequestSnap();
|
||||
// Same as above, but takes into account the current velocity to find a
|
||||
// predicted destination.
|
||||
void RequestSnapToDestination();
|
||||
|
||||
uint64_t mLayersId;
|
||||
RefPtr<CompositorParent> mCompositorParent;
|
||||
|
Loading…
Reference in New Issue
Block a user