Skip to content

Instantly share code, notes, and snippets.

@AEnMe
Created July 17, 2020 14:00
Show Gist options
  • Save AEnMe/0da7366e512c1eef0074f9ace2cfbb29 to your computer and use it in GitHub Desktop.
Save AEnMe/0da7366e512c1eef0074f9ace2cfbb29 to your computer and use it in GitHub Desktop.
n = 0;
if (numKeys > 0) {
n = nearestKey(time).index;
if (key(n).time > time) {
n--;
}
}
if (n == 0) {
time - inPoint;
} else {
if (numKeys > n) {
tMax = key(n + 1);
} else {
tMax = comp(name).duration;
}
tMin = key(n) + time - key(n).time;
Math.min(tMin, tMax);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment