mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-05-11 02:13:56 +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,
|
animationReachCallback,
|
||||||
0.,
|
0.,
|
||||||
1.,
|
1.,
|
||||||
kBounceDuration);
|
state->finishByTopData.reachRatioDuration
|
||||||
|
? state->finishByTopData.reachRatioDuration
|
||||||
|
: kBounceDuration);
|
||||||
base::Platform::Haptic();
|
base::Platform::Haptic();
|
||||||
} else if (state->reached
|
} else if (state->reached
|
||||||
&& ratio < kResetReachedOn) {
|
&& ratio < kResetReachedOn) {
|
||||||
|
@ -272,7 +274,9 @@ void SetupSwipeHandler(
|
||||||
animationReachCallback,
|
animationReachCallback,
|
||||||
1.,
|
1.,
|
||||||
0.,
|
0.,
|
||||||
kBounceDuration);
|
state->finishByTopData.reachRatioDuration
|
||||||
|
? state->finishByTopData.reachRatioDuration
|
||||||
|
: kBounceDuration);
|
||||||
}
|
}
|
||||||
state->reached = false;
|
state->reached = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ struct SwipeHandlerFinishData {
|
||||||
Fn<void(void)> callback;
|
Fn<void(void)> callback;
|
||||||
int64 msgBareId = 0;
|
int64 msgBareId = 0;
|
||||||
float64 speedRatio = 1.0;
|
float64 speedRatio = 1.0;
|
||||||
|
crl::time reachRatioDuration = 0;
|
||||||
bool keepRatioWithinRange = false;
|
bool keepRatioWithinRange = false;
|
||||||
bool provideReachOutRatio = false;
|
bool provideReachOutRatio = false;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue