diff --git a/Lib/fontTools/varLib/instancer/solver.py b/Lib/fontTools/varLib/instancer/solver.py index 468f04277..b604525bb 100644 --- a/Lib/fontTools/varLib/instancer/solver.py +++ b/Lib/fontTools/varLib/instancer/solver.py @@ -100,7 +100,7 @@ def _solve(tent, axisLimit, negative=False): if gain > outGain: # Crossing point on the axis. - crossing = peak + ((1 - gain) * (upper - peak) / (1 - outGain)) + crossing = peak + (1 - gain) * (upper - peak) loc = (axisDef, peak, crossing) scalar = 1 diff --git a/Tests/varLib/instancer/solver_test.py b/Tests/varLib/instancer/solver_test.py index 241a824cb..8b2a8fc47 100644 --- a/Tests/varLib/instancer/solver_test.py +++ b/Tests/varLib/instancer/solver_test.py @@ -91,6 +91,25 @@ class RebaseTentTest(object): (-1, (-1, -1, 0)), ], ), + pytest.param( + (0.0, 0.5, 1), + (0, 0.5, 0.75), + [ + (1, None), + (-0.5, (0, 1, 1)), + (-1, (-1, -1, 0)), + ], + ), + pytest.param( + (0.0, 0.5, 1), + (0, 0.25, 0.8), + [ + (0.5, None), + (0.5, (0, 0.45454545, 0.9090909090)), + (-0.1, (0.9090909090, 1.0, 1.0)), + (-0.5, (-1, -1, 0)), + ], + ), # Case 3a/1neg pytest.param( (0.0, 0.5, 2),