@@ -1164,10 +1164,10 @@ def polygon_remove_vertex(xdata, ydata):
1164
1164
('release' ,dict (xdata = xdata ,ydata = ydata ,button = 3 ))]
1165
1165
1166
1166
1167
- @pytest .mark .parametrize ('draw_box ' , [False ,True ])
1168
- def test_polygon_selector (draw_box ):
1167
+ @pytest .mark .parametrize ('draw_bounding_box ' , [False ,True ])
1168
+ def test_polygon_selector (draw_bounding_box ):
1169
1169
check_selector = functools .partial (
1170
- check_polygon_selector ,draw_box = draw_box )
1170
+ check_polygon_selector ,draw_bounding_box = draw_bounding_box )
1171
1171
1172
1172
# Simple polygon
1173
1173
expected_result = [(50 ,50 ), (150 ,50 ), (50 ,150 )]
@@ -1264,8 +1264,8 @@ def test_polygon_selector(draw_box):
1264
1264
check_selector (event_sequence ,expected_result ,1 )
1265
1265
1266
1266
1267
- @pytest .mark .parametrize ('draw_box ' , [False ,True ])
1268
- def test_polygon_selector_set_props_handle_props (draw_box ):
1267
+ @pytest .mark .parametrize ('draw_bounding_box ' , [False ,True ])
1268
+ def test_polygon_selector_set_props_handle_props (draw_bounding_box ):
1269
1269
ax = get_ax ()
1270
1270
1271
1271
ax ._selections_count = 0
@@ -1277,7 +1277,7 @@ def onselect(vertices):
1277
1277
tool = widgets .PolygonSelector (ax ,onselect ,
1278
1278
props = dict (color = 'b' ,alpha = 0.2 ),
1279
1279
handle_props = dict (alpha = 0.5 ),
1280
- draw_box = draw_box )
1280
+ draw_bounding_box = draw_bounding_box )
1281
1281
1282
1282
event_sequence = (polygon_place_vertex (50 ,50 )
1283
1283
+ polygon_place_vertex (150 ,50 )
@@ -1319,8 +1319,8 @@ def onselect(verts):
1319
1319
1320
1320
# Change the order that the extra point is inserted in
1321
1321
@pytest .mark .parametrize ('idx' , [1 ,2 ,3 ])
1322
- @pytest .mark .parametrize ('draw_box ' , [False ,True ])
1323
- def test_polygon_selector_remove (idx ,draw_box ):
1322
+ @pytest .mark .parametrize ('draw_bounding_box ' , [False ,True ])
1323
+ def test_polygon_selector_remove (idx ,draw_bounding_box ):
1324
1324
verts = [(50 ,50 ), (150 ,50 ), (50 ,150 )]
1325
1325
event_sequence = [polygon_place_vertex (* verts [0 ]),
1326
1326
polygon_place_vertex (* verts [1 ]),
@@ -1333,22 +1333,24 @@ def test_polygon_selector_remove(idx, draw_box):
1333
1333
event_sequence .append (polygon_remove_vertex (200 ,200 ))
1334
1334
# Flatten list of lists
1335
1335
event_sequence = sum (event_sequence , [])
1336
- check_polygon_selector (event_sequence ,verts ,2 ,draw_box = draw_box )
1336
+ check_polygon_selector (event_sequence ,verts ,2 ,
1337
+ draw_bounding_box = draw_bounding_box )
1337
1338
1338
1339
1339
- @pytest .mark .parametrize ('draw_box ' , [False ,True ])
1340
- def test_polygon_selector_remove_first_point (draw_box ):
1340
+ @pytest .mark .parametrize ('draw_bounding_box ' , [False ,True ])
1341
+ def test_polygon_selector_remove_first_point (draw_bounding_box ):
1341
1342
verts = [(50 ,50 ), (150 ,50 ), (50 ,150 )]
1342
1343
event_sequence = (polygon_place_vertex (* verts [0 ])+
1343
1344
polygon_place_vertex (* verts [1 ])+
1344
1345
polygon_place_vertex (* verts [2 ])+
1345
1346
polygon_place_vertex (* verts [0 ])+
1346
1347
polygon_remove_vertex (* verts [0 ]))
1347
- check_polygon_selector (event_sequence ,verts [1 :],2 ,draw_box = draw_box )
1348
+ check_polygon_selector (event_sequence ,verts [1 :],2 ,
1349
+ draw_bounding_box = draw_bounding_box )
1348
1350
1349
1351
1350
- @pytest .mark .parametrize ('draw_box ' , [False ,True ])
1351
- def test_polygon_selector_redraw (draw_box ):
1352
+ @pytest .mark .parametrize ('draw_bounding_box ' , [False ,True ])
1353
+ def test_polygon_selector_redraw (draw_bounding_box ):
1352
1354
verts = [(50 ,50 ), (150 ,50 ), (50 ,150 )]
1353
1355
event_sequence = (polygon_place_vertex (* verts [0 ])+
1354
1356
polygon_place_vertex (* verts [1 ])+
@@ -1366,7 +1368,8 @@ def test_polygon_selector_redraw(draw_box):
1366
1368
def onselect (vertices ):
1367
1369
pass
1368
1370
1369
- tool = widgets .PolygonSelector (ax ,onselect ,draw_box = draw_box )
1371
+ tool = widgets .PolygonSelector (ax ,onselect ,
1372
+ draw_bounding_box = draw_bounding_box )
1370
1373
for (etype ,event_args )in event_sequence :
1371
1374
do_event (tool ,etype ,** event_args )
1372
1375
# After removing two verts, only one remains, and the
@@ -1411,7 +1414,7 @@ def onselect(vertices):
1411
1414
pass
1412
1415
1413
1416
# Create selector
1414
- tool = widgets .PolygonSelector (ax ,onselect ,draw_box = True )
1417
+ tool = widgets .PolygonSelector (ax ,onselect ,draw_bounding_box = True )
1415
1418
for (etype ,event_args )in event_sequence :
1416
1419
do_event (tool ,etype ,** event_args )
1417
1420