Skip to content

Commit

Permalink
[instancer-solver] Fix a bug
Browse files Browse the repository at this point in the history
Fixes #3139
  • Loading branch information
behdad committed May 29, 2023
1 parent b8dcb85 commit 661d6fc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/fontTools/varLib/instancer/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def _solve(tent, axisLimit, negative=False):
# Crossing point on the axis.
crossing = peak + ((1 - gain) * (upper - peak) / (1 - outGain))

loc = (peak, peak, crossing)
loc = (axisDef, peak, crossing)
scalar = 1

# The part before the crossing point.
Expand Down
12 changes: 12 additions & 0 deletions Tests/varLib/instancer/solver_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,18 @@ class RebaseTentTest(object):
(1, (0, 0.4, 1.99994)),
],
),
# https://github.com/fonttools/fonttools/issues/3139
pytest.param(
(0, 0.5, 1),
(-1, .25, 1),
[
(.5, None),
(0.5, (0.0, 1/3, 2/3)),
(-0.5, (2/3, 1, 1)),
(-0.5, (-1, -.2, 0)),
(-0.5, (-1, -1, -.2)),
],
),
# Dirac delta at new default. Fancy!
pytest.param(
(0.5, 0.5, 0.5),
Expand Down

0 comments on commit 661d6fc

Please sign in to comment.