mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-05-09 09:23:58 +02:00
Added ability to provide reach ratio speed to swipe.
This commit is contained in:
parent
ad9106b815
commit
c29d78ac0d
2 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue