[gvar] Rewrite linear interpolation
This commit is contained in:
parent
57519b532d
commit
5be6e5dd57
|
@ -536,7 +536,7 @@ struct gvar
|
|||
|
||||
/* linear interpolation */
|
||||
float r = (target_val - prev_val) / (next_val - prev_val);
|
||||
return (1.f - r) * prev_delta + r * next_delta;
|
||||
return prev_delta + r * (next_delta - prev_delta);
|
||||
}
|
||||
|
||||
static unsigned int next_index (unsigned int i, unsigned int start, unsigned int end)
|
||||
|
|
Loading…
Reference in New Issue