(path, extents)
| 107 | |
| 108 | @pytest.mark.parametrize('path, extents', zip(_test_paths, _test_path_extents)) |
| 109 | def test_exact_extents(path, extents): |
| 110 | # notice that if we just looked at the control points to get the bounding |
| 111 | # box of each curve, we would get the wrong answers. For example, for |
| 112 | # hard_curve = Path([[0, 0], [1, 0], [1, 1], [0, 1]], |
| 113 | # [Path.MOVETO, Path.CURVE4, Path.CURVE4, Path.CURVE4]) |
| 114 | # we would get that the extents area (0, 0, 1, 1). This code takes into |
| 115 | # account the curved part of the path, which does not typically extend all |
| 116 | # the way out to the control points. |
| 117 | # Note that counterintuitively, path.get_extents() returns a Bbox, so we |
| 118 | # have to get that Bbox's `.extents`. |
| 119 | assert np.all(path.get_extents().extents == extents) |
| 120 | |
| 121 | |
| 122 | @pytest.mark.parametrize('ignored_code', [Path.CLOSEPOLY, Path.STOP]) |
nothing calls this directly
no test coverage detected
searching dependent graphs…