Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/matplotlib/tests/test_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ def test_point_in_path():

assert np.all(path.contains_points(points) == [True, False])

def test_contains_points_negative_radius():
path = Path.unit_circle()

points = [(0.0, 0.0), (1.25, 0.0), (0.9, 0.9)]
expected = [True, False, False]

assert np.all(path.contains_points(points, radius=-0.5) == expected)

if __name__ == '__main__':
import nose
Expand Down
2 changes: 1 addition & 1 deletion src/_path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ points_in_path(const void* const points, const size_t s0,
no_nans_t no_nans_path(trans_path, true, path.has_curves());
curve_t curved_path(no_nans_path);
contour_t contoured_path(curved_path);
contoured_path.width(fabs(r));
contoured_path.width(r);
point_in_path_impl(points, s0, s1, n, contoured_path, result);
}

Expand Down