mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-30 14:08:41 +00:00
Added ability to provide reach ratio speed to swipe.
This commit is contained in:
@@ -262,7 +262,9 @@ void SetupSwipeHandler(
|
||||
animationReachCallback,
|
||||
0.,
|
||||
1.,
|
||||
kBounceDuration);
|
||||
state->finishByTopData.reachRatioDuration
|
||||
? state->finishByTopData.reachRatioDuration
|
||||
: kBounceDuration);
|
||||
base::Platform::Haptic();
|
||||
} else if (state->reached
|
||||
&& ratio < kResetReachedOn) {
|
||||
@@ -272,7 +274,9 @@ void SetupSwipeHandler(
|
||||
animationReachCallback,
|
||||
1.,
|
||||
0.,
|
||||
kBounceDuration);
|
||||
state->finishByTopData.reachRatioDuration
|
||||
? state->finishByTopData.reachRatioDuration
|
||||
: kBounceDuration);
|
||||
}
|
||||
state->reached = false;
|
||||
}
|
||||
|
@@ -22,6 +22,7 @@ struct SwipeHandlerFinishData {
|
||||
Fn<void(void)> callback;
|
||||
int64 msgBareId = 0;
|
||||
float64 speedRatio = 1.0;
|
||||
crl::time reachRatioDuration = 0;
|
||||
bool keepRatioWithinRange = false;
|
||||
bool provideReachOutRatio = false;
|
||||
};
|
||||
|
Reference in New Issue
Block a user