Replies: 1 comment
-
That's a great question and one that comes up a lot. We don't offer such utility function at the moment. You would have to build it yourself currently. Here's a very rough example: function lerpArray(a: number[], b: number[], t: number): number[] {
"worklet";
if (a.length !== b.length) {
throw new Error('Arrays must have the same length');
}
let result: number[] = [];
for (let i = 0; i < a.length; i++) {
result[i] = (1 - t) * a[i] + t * b[i];
}
return result;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm doing a zoom function. But I want to scale up the image, for this reason I want to reset the scale value to 1 when the scale is lower than 1.
Example code:
I'm using code from Stickers
Problem
Currently when I set scale value to 1, it transforms it without any animation. I would like to add spring animation. Is it possible to achieve it?
Beta Was this translation helpful? Give feedback.
All reactions