diff --git a/.venv/lib/python3.11/site-packages/matplotlib/tests/test_widgets.py b/.venv/lib/python3.11/site-packages/matplotlib/tests/test_widgets.py index 1ecb4b9..f90b3a0 100644 --- a/.venv/lib/python3.11/site-packages/matplotlib/tests/test_widgets.py +++ b/.venv/lib/python3.11/site-packages/matplotlib/tests/test_widgets.py @@ -455,15 +455,15 @@ def test_rectangle_rotate(ax, selector_class): # Draw rectangle click_and_drag(tool, start=(100, 100), end=(130, 140)) assert tool.extents == (100, 130, 100, 140) - assert len(tool._state) == 0 + assert len(tool.state) == 0 # Rotate anticlockwise using top-right corner do_event(tool, 'on_key_press', key='r') - assert tool._state == {'rotate'} - assert len(tool._state) == 1 + assert tool.state == {'rotate'} + assert len(tool.state) == 1 click_and_drag(tool, start=(130, 140), end=(120, 145)) do_event(tool, 'on_key_press', key='r') - assert len(tool._state) == 0 + assert len(tool.state) == 0 # Extents shouldn't change (as shape of rectangle hasn't changed) assert tool.extents == (100, 130, 100, 140) assert_allclose(tool.rotation, 25.56, atol=0.01) @@ -488,12 +488,12 @@ def test_rectangle_add_remove_set(ax): # Draw rectangle click_and_drag(tool, start=(100, 100), end=(130, 140)) assert tool.extents == (100, 130, 100, 140) - assert len(tool._state) == 0 + assert len(tool.state) == 0 for state in ['rotate', 'square', 'center']: tool.add_state(state) - assert len(tool._state) == 1 + assert len(tool.state) == 1 tool.remove_state(state) - assert len(tool._state) == 0 + assert len(tool.state) == 0 @pytest.mark.parametrize('use_data_coordinates', [False, True]) diff --git a/.venv/lib/python3.11/site-packages/matplotlib/widgets.py b/.venv/lib/python3.11/site-packages/matplotlib/widgets.py index 0a31a9d..86f4340 100644 --- a/.venv/lib/python3.11/site-packages/matplotlib/widgets.py +++ b/.venv/lib/python3.11/site-packages/matplotlib/widgets.py @@ -2394,8 +2394,8 @@ class _SelectorWidget(AxesWidget): return for (state, modifier) in self._state_modifier_keys.items(): if modifier in key.split('+'): - # 'rotate' is changing _state on press and is not removed - # from _state when releasing + # 'rotate' is changing state on press and is not removed + # from state when releasing if state == 'rotate': if state in self._state: self._state.discard(state) @@ -2413,8 +2413,8 @@ class _SelectorWidget(AxesWidget): if self.active: key = event.key or '' for (state, modifier) in self._state_modifier_keys.items(): - # 'rotate' is changing _state on press and is not removed - # from _state when releasing + # 'rotate' is changing state on press and is not removed + # from state when releasing if modifier in key.split('+') and state != 'rotate': self._state.discard(state) self._on_key_release(event)