Fix the linear interpolation during weight mapping

Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/164
This commit is contained in:
Egmont Koblinger 2019-06-19 11:45:05 +02:00
parent c0dc76268b
commit f2d4291d12
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ static double lerp(double x, int x1, int x2, int y1, int y2)
int dx = x2 - x1; int dx = x2 - x1;
int dy = y2 - y1; int dy = y2 - y1;
assert (dx > 0 && dy >= 0 && x1 <= x && x <= x2); assert (dx > 0 && dy >= 0 && x1 <= x && x <= x2);
return y1 + (dy*(x-x1) + dx/2) / dx; return y1 + (x-x1) * dy / dx;
} }
double double