fix incorrectly typed cython local variable
Fixes https://github.com/fonttools/fonttools/issues/3287
This commit is contained in:
parent
c5295d2f16
commit
21dea1e18d
@ -141,7 +141,7 @@ def _dot(v1, v2):
|
|||||||
@cython.cfunc
|
@cython.cfunc
|
||||||
@cython.inline
|
@cython.inline
|
||||||
@cython.returns(cython.double)
|
@cython.returns(cython.double)
|
||||||
@cython.locals(x=cython.complex)
|
@cython.locals(x=cython.double)
|
||||||
def _intSecAtan(x):
|
def _intSecAtan(x):
|
||||||
# In : sympy.integrate(sp.sec(sp.atan(x)))
|
# In : sympy.integrate(sp.sec(sp.atan(x)))
|
||||||
# Out: x*sqrt(x**2 + 1)/2 + asinh(x)/2
|
# Out: x*sqrt(x**2 + 1)/2 + asinh(x)/2
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import fontTools.misc.bezierTools as bezierTools
|
import fontTools.misc.bezierTools as bezierTools
|
||||||
from fontTools.misc.bezierTools import (
|
from fontTools.misc.bezierTools import (
|
||||||
calcQuadraticBounds,
|
calcQuadraticBounds,
|
||||||
|
calcQuadraticArcLength,
|
||||||
calcCubicBounds,
|
calcCubicBounds,
|
||||||
curveLineIntersections,
|
curveLineIntersections,
|
||||||
segmentPointAtT,
|
segmentPointAtT,
|
||||||
@ -181,3 +182,10 @@ def test_intersections_straight_line():
|
|||||||
e = (110, 0)
|
e = (110, 0)
|
||||||
pt = (109.05194805194802, 0.0)
|
pt = (109.05194805194802, 0.0)
|
||||||
assert bezierTools._line_t_of_pt(s, e, pt) == pytest.approx(0.98958184)
|
assert bezierTools._line_t_of_pt(s, e, pt) == pytest.approx(0.98958184)
|
||||||
|
|
||||||
|
|
||||||
|
def test_calcQuadraticArcLength():
|
||||||
|
# https://github.com/fonttools/fonttools/issues/3287
|
||||||
|
assert calcQuadraticArcLength(
|
||||||
|
(210, 333), (289, 333), (326.5, 290.5)
|
||||||
|
) == pytest.approx(127.9225)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user