mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Added ability to provide reach ratio speed to swipe.
This commit is contained in:
@@ -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;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user