Skip to content

Commit

Permalink
Minor comment and test tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed Apr 19, 2024
1 parent 33a454a commit 5454453
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
11 changes: 1 addition & 10 deletions path_intersection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,7 @@ func TestIntersectionLineLine(t *testing.T) {
line2.Scan()

zs := intersectionLineLine(nil, line1.Start(), line1.End(), line2.Start(), line2.End())
for i := range tt.zs {
if i < len(zs) {
test.T(t, zs[i], tt.zs[i])
} else {
test.Fail(t, "expected", test.Green, tt.zs[i], test.Reset)
}
}
for j := len(tt.zs); j < len(zs); j++ {
test.Fail(t, "unexpected", test.Red, zs[j], test.Reset)
}
test.T(t, zs, tt.zs)
})
}
}
Expand Down
4 changes: 2 additions & 2 deletions path_intersection_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -1069,11 +1069,11 @@ func intersectionLineLine(zs Intersections, a0, a1, b0, b1 Point) Intersections
}
return zs
} else if a1.Equals(b0) {
// handle common case to avoid numerical issues
// handle common cases with endpoints to avoid numerical issues
zs = zs.add(a1, 1.0, 0.0, angle0, angle1, true)
return zs
} else if a0.Equals(b1) {
// handle common case to avoid numerical issues
// handle common cases with endpoints to avoid numerical issues
zs = zs.add(a0, 0.0, 1.0, angle0, angle1, true)
return zs
}
Expand Down

0 comments on commit 5454453

Please # to comment.