Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5be59ab

Browse files
committed
Merge pull request matplotlib#3313 from eyurtsev/fix-minor-widgets-issues
BUG : 3 fixes for widgets (MultiCrusor, SpanSelector, Slider)
2 parents 958c938 + a34bd13 commit 5be59ab

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/matplotlib/widgets.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def set_val(self, val):
425425
self.poly.xy = xy
426426
self.valtext.set_text(self.valfmt % val)
427427
if self.drawon:
428-
self.ax.figure.canvas.draw()
428+
self.ax.figure.canvas.draw_idle()
429429
self.val = val
430430
if not self.eventson:
431431
return
@@ -1011,7 +1011,7 @@ def __init__(self, canvas, axes, useblit=True, horizOn=False, vertOn=True,
10111011
self.background = None
10121012
self.needclear = False
10131013

1014-
if useblit:
1014+
if self.useblit:
10151015
lineprops['animated'] = True
10161016

10171017
if vertOn:
@@ -1198,6 +1198,9 @@ def update_background(self, event):
11981198

11991199
def ignore(self, event):
12001200
"""return *True* if *event* should be ignored"""
1201+
# If canvas was locked
1202+
if not self.canvas.widgetlock.available(self):
1203+
return True
12011204
widget_off = not self.visible or not self.active
12021205
non_event = event.inaxes != self.ax or event.button != 1
12031206
return widget_off or non_event

0 commit comments

Comments
 (0)