(ax, draw_bounding_box)
| 1632 | |
| 1633 | @pytest.mark.parametrize('draw_bounding_box', [False, True]) |
| 1634 | def test_polygon_selector_redraw(ax, draw_bounding_box): |
| 1635 | verts = [(50, 50), (150, 50), (50, 150)] |
| 1636 | event_sequence = [ |
| 1637 | *polygon_place_vertex(ax, verts[0]), |
| 1638 | *polygon_place_vertex(ax, verts[1]), |
| 1639 | *polygon_place_vertex(ax, verts[2]), |
| 1640 | *polygon_place_vertex(ax, verts[0]), |
| 1641 | # Polygon completed, now remove first two verts. |
| 1642 | *polygon_remove_vertex(ax, verts[1]), |
| 1643 | *polygon_remove_vertex(ax, verts[2]), |
| 1644 | # At this point the tool should be reset so we can add more vertices. |
| 1645 | *polygon_place_vertex(ax, verts[1]), |
| 1646 | ] |
| 1647 | |
| 1648 | tool = widgets.PolygonSelector(ax, draw_bounding_box=draw_bounding_box) |
| 1649 | for event in event_sequence: |
| 1650 | event._process() |
| 1651 | # After removing two verts, only one remains, and the |
| 1652 | # selector should be automatically reset |
| 1653 | assert tool.verts == verts[0:2] |
| 1654 | |
| 1655 | |
| 1656 | @pytest.mark.parametrize('draw_bounding_box', [False, True]) |
nothing calls this directly
no test coverage detected
searching dependent graphs…