@@ -90,8 +90,9 @@ def onselect(epress, erelease):
90
90
91
91
if kwargs .get ('drawtype' , None ) not in ['line' , 'none' ]:
92
92
assert_allclose (tool .geometry ,
93
- [[100. , 100 , 199 , 199 , 100 ], [100 , 199 , 199 , 100 , 100 ]],
94
- err_msg = tool .geometry )
93
+ [[100. , 100 , 199 , 199 , 100 ],
94
+ [100 , 199 , 199 , 100 , 100 ]],
95
+ err_msg = tool .geometry )
95
96
96
97
assert ax ._got_onselect
97
98
@@ -118,41 +119,41 @@ def onselect(epress, erelease):
118
119
119
120
# drag the rectangle
120
121
do_event (tool , 'press' , xdata = 10 , ydata = 10 , button = 1 ,
121
- key = ' ' )
122
+ key = ' ' )
122
123
123
124
do_event (tool , 'onmove' , xdata = 30 , ydata = 30 , button = 1 )
124
125
do_event (tool , 'release' , xdata = 30 , ydata = 30 , button = 1 )
125
126
assert tool .extents == (120 , 170 , 120 , 170 )
126
127
127
128
# create from center
128
129
do_event (tool , 'on_key_press' , xdata = 100 , ydata = 100 , button = 1 ,
129
- key = 'control' )
130
+ key = 'control' )
130
131
do_event (tool , 'press' , xdata = 100 , ydata = 100 , button = 1 )
131
132
do_event (tool , 'onmove' , xdata = 125 , ydata = 125 , button = 1 )
132
133
do_event (tool , 'release' , xdata = 125 , ydata = 125 , button = 1 )
133
134
do_event (tool , 'on_key_release' , xdata = 100 , ydata = 100 , button = 1 ,
134
- key = 'control' )
135
+ key = 'control' )
135
136
assert tool .extents == (75 , 125 , 75 , 125 )
136
137
137
138
# create a square
138
139
do_event (tool , 'on_key_press' , xdata = 10 , ydata = 10 , button = 1 ,
139
- key = 'shift' )
140
+ key = 'shift' )
140
141
do_event (tool , 'press' , xdata = 10 , ydata = 10 , button = 1 )
141
142
do_event (tool , 'onmove' , xdata = 35 , ydata = 30 , button = 1 )
142
143
do_event (tool , 'release' , xdata = 35 , ydata = 30 , button = 1 )
143
144
do_event (tool , 'on_key_release' , xdata = 10 , ydata = 10 , button = 1 ,
144
- key = 'shift' )
145
+ key = 'shift' )
145
146
extents = [int (e ) for e in tool .extents ]
146
147
assert extents == [10 , 35 , 10 , 34 ]
147
148
148
149
# create a square from center
149
150
do_event (tool , 'on_key_press' , xdata = 100 , ydata = 100 , button = 1 ,
150
- key = 'ctrl+shift' )
151
+ key = 'ctrl+shift' )
151
152
do_event (tool , 'press' , xdata = 100 , ydata = 100 , button = 1 )
152
153
do_event (tool , 'onmove' , xdata = 125 , ydata = 130 , button = 1 )
153
154
do_event (tool , 'release' , xdata = 125 , ydata = 130 , button = 1 )
154
155
do_event (tool , 'on_key_release' , xdata = 100 , ydata = 100 , button = 1 ,
155
- key = 'ctrl+shift' )
156
+ key = 'ctrl+shift' )
156
157
extents = [int (e ) for e in tool .extents ]
157
158
assert extents == [70 , 129 , 70 , 130 ]
158
159
@@ -273,7 +274,7 @@ def test_check_radio_buttons_image():
273
274
(False , True , True ))
274
275
275
276
276
- @image_comparison (baseline_images = ['check_bunch_of_radio_buttons' ],
277
+ @image_comparison (baseline_images = ['check_bunch_of_radio_buttons' ],
277
278
extensions = ['png' ])
278
279
def test_check_bunch_of_radio_buttons ():
279
280
rax = plt .axes ([0.05 , 0.1 , 0.15 , 0.7 ])
@@ -452,3 +453,4 @@ def test_polygon_selector():
452
453
+ polygon_place_vertex (50 , 150 )
453
454
+ polygon_place_vertex (50 , 50 ))
454
455
check_polygon_selector (event_sequence , expected_result , 1 )
456
+
0 commit comments