OvershootClamping does not work since v1.5.0
See original GitHub issueHey everyone. Thanks for a great library.
I’m trying to implement an animation that runs a spring with overshootClamping. The code was working fine until I upgraded Reanimated
to the newest version. Below is the code in question:
function runSpring(
clock: Animated.Clock,
animationState: Animated.PhysicsAnimationState,
): Animated.Node<number> {
const config = {
...SpringUtils.makeDefaultConfig(),
overshootClamping: true,
};
return block([
cond(not(clockRunning(clock)), [
set(animationState.finished, 0),
startClock(clock),
]),
spring(clock, animationState, config),
cond(animationState.finished, stopClock(clock)),
animationState.position,
]);
}
There seems to have been some regression in v1.5.0
, because the code above no longer works properly. The animation does not apply the overshootClamping: true
to the configuration.
Hopefully this can be fixed in future versions, as this issue prevents me from upgrading past version 1.4.0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:10 (5 by maintainers)
Top Results From Across the Web
[Animated] Spring doesn't respect overshootClamping as a ...
[Animated] Spring doesn't respect overshootClamping as a hard stop. mkonicek. Moved from https://github.com/facebook/react-native/issues/2409.
Read more >github.com-kmagiera-react-native-reanimated_ ... - Internet Archive
The problem there was that even though using Animated.event we could map gesture state to the position of the box and make this...
Read more >Free Automated Malware Analysis Service - powered by Falcon ...
Submit malware for free analysis with Falcon Sandbox and Hybrid Analysis technology. Hybrid Analysis develops and licenses analysis tools to fight malware.
Read more >HV7322 8-Channel 7-Level ±80V High Voltage Pulser with T/R ...
The HV7322 device is an 8-channel, true 5-level or ... Each of the pulsers has output voltage overshoot clamping diodes to the highest...
Read more >Power Management & Supply
If the flyback current (ILPK and ISEC) does not reach zero before the next ... ICE2AXXX, as a function of the supply voltage...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I managed to reproduce it on a snappable example in REA Example app.
After bisecting, it seems #468 (2dc3df7) introduced this regression.
@felixakiragreen, @Sakarisson
A possible workaround is to change
export default (...)
at the end ofsrc/animation/spring.js
toexport default spring;
You can use patch-package library to do it, here’s a quick blog post about it