Skip to content

Commit

Permalink
Tests for fonttools#3352
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens committed Nov 27, 2023
1 parent 25e60d5 commit 1063d5b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Tests/misc/bezierTools_test.py
Expand Up @@ -4,6 +4,7 @@
calcQuadraticArcLength,
calcCubicBounds,
curveLineIntersections,
curveCurveIntersections,
segmentPointAtT,
splitLine,
splitQuadratic,
Expand Down Expand Up @@ -189,3 +190,10 @@ def test_calcQuadraticArcLength():
assert calcQuadraticArcLength(
(210, 333), (289, 333), (326.5, 290.5)
) == pytest.approx(127.9225)


def test_intersections_linelike():
seg1 = [(0.0, 0.0), (0.0, 0.25), (0.0, 0.75), (0.0, 1.0)]
seg2 = [(0.0, 0.5), (0.25, 0.5), (0.75, 0.5), (1.0, 0.5)]
pt = curveCurveIntersections(seg1, seg2)[0][0]
assert pt == (0.0, 0.5)

0 comments on commit 1063d5b

Please sign in to comment.