[instancer-solver] Fix a bug
Fixes https://github.com/fonttools/fonttools/issues/3139
This commit is contained in:
parent
b8dcb85161
commit
3ba7e6d706
@ -102,7 +102,7 @@ def _solve(tent, axisLimit, negative=False):
|
|||||||
# Crossing point on the axis.
|
# Crossing point on the axis.
|
||||||
crossing = peak + ((1 - gain) * (upper - peak) / (1 - outGain))
|
crossing = peak + ((1 - gain) * (upper - peak) / (1 - outGain))
|
||||||
|
|
||||||
loc = (peak, peak, crossing)
|
loc = (axisDef, peak, crossing)
|
||||||
scalar = 1
|
scalar = 1
|
||||||
|
|
||||||
# The part before the crossing point.
|
# The part before the crossing point.
|
||||||
|
@ -218,6 +218,18 @@ class RebaseTentTest(object):
|
|||||||
(1, (0, 0.4, 1.99994)),
|
(1, (0, 0.4, 1.99994)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
# https://github.com/fonttools/fonttools/issues/3139
|
||||||
|
pytest.param(
|
||||||
|
(0, 0.5, 1),
|
||||||
|
(-1, 0.25, 1),
|
||||||
|
[
|
||||||
|
(0.5, None),
|
||||||
|
(0.5, (0.0, 1 / 3, 2 / 3)),
|
||||||
|
(-0.5, (2 / 3, 1, 1)),
|
||||||
|
(-0.5, (-1, -0.2, 0)),
|
||||||
|
(-0.5, (-1, -1, -0.2)),
|
||||||
|
],
|
||||||
|
),
|
||||||
# Dirac delta at new default. Fancy!
|
# Dirac delta at new default. Fancy!
|
||||||
pytest.param(
|
pytest.param(
|
||||||
(0.5, 0.5, 0.5),
|
(0.5, 0.5, 0.5),
|
||||||
@ -233,7 +245,6 @@ class RebaseTentTest(object):
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_rebaseTent(self, tent, axisRange, expected):
|
def test_rebaseTent(self, tent, axisRange, expected):
|
||||||
|
|
||||||
sol = solver.rebaseTent(tent, axisRange)
|
sol = solver.rebaseTent(tent, axisRange)
|
||||||
|
|
||||||
a = pytest.approx
|
a = pytest.approx
|
||||||
|
Loading…
x
Reference in New Issue
Block a user