8000 Apply suggestions from code review · matplotlib/matplotlib@832d55e · GitHub
[go: up one dir, main page]

Skip to content

Commit 832d55e

Browse files
dstansbyQuLogic
andauthored
Apply suggestions from code review
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
1 parent bbf32b8 commit 832d55e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

doc/users/next_whats_new/widget_dragging.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Dragging selectors
33

44
The `~matplotlib.widgets.RectangleSelector` and
55
`~matplotlib.widgets.EllipseSelector` have a new keyword argument,
6-
``drag_from_anywhere``, which when set to `True` allows you to click and drag
6+
*drag_from_anywhere*, which when set to `True` allows you to click and drag
77
from anywhere inside the selector to move it. Previously it was only possible
88
to move it by either activating the move modifier button, or clicking on the
99
central handle.

lib/matplotlib/tests/test_widgets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def onselect(epress, erelease):
6161
do_event(tool, 'release', xdata=100, ydata=100, button=1)
6262
assert tool.center == (50, 50)
6363
# Drag inside rectangle, but away from centre handle to make sure rectangle
64-
# is still moved
64+
# is still moved, if *drag_from_anywhere* is enabled.
6565
do_event(tool, 'press', xdata=25, ydata=25, button=1)
6666
do_event(tool, 'onmove', xdata=75, ydata=75, button=1)
6767
do_event(tool, 'release', xdata=75, ydata=75, button=1)

lib/matplotlib/widgets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2551,7 +2551,7 @@ def _set_active_handle(self, event):
25512551
elif m_dist < self.maxdist * 2:
25522552
# Prioritise center handle over other handles
25532553
self.active_handle = 'C'
2554-
elif (c_dist > self.maxdist and e_dist > self.maxdist):
2554+
elif c_dist > self.maxdist and e_dist > self.maxdist:
25552555
# Not close to any handles
25562556
if self.drag_from_anywhere and contains:
25572557
# Check if we've clicked inside the region

0 commit comments

Comments
 (0)
0