Skip to content

Commit

Permalink
removed assert from interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
BrennoCaldato committed May 24, 2021
1 parent cd7d6fe commit ae0a635
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/KeyFrame.cpp
Expand Up @@ -94,8 +94,14 @@ namespace openshot{
}
// Interpolate two points using the right Point's interpolation method
double InterpolateBetween(Point const & left, Point const & right, double target, double allowed_error) {
assert(left.co.X < target);
assert(target <= right.co.X);
// check if target is outside of the extremities poits
// This can occur when moving fast the play head
if(left.co.X > target){
return left.co.Y;
}
if(target > right.co.X){
return right.co.Y;
}
switch (right.interpolation) {
case CONSTANT: return left.co.Y;
case LINEAR: return InterpolateLinearCurve(left, right, target);
Expand Down

0 comments on commit ae0a635

Please sign in to comment.