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

Skip to content

Commit 01afbda

Browse files
committed
Fix Button widget motion callback.
1 parent b160322 commit 01afbda

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/matplotlib/widgets.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,9 @@ def _release(self, event):
212212
def _motion(self, event):
213213
if self.ignore(event):
214214
return
215-
if event.inaxes == self.ax:
216-
c = self.hovercolor
217-
else:
218-
c = self.color
219-
if c != self._lastcolor:
215+
c = self.hovercolor if event.inaxes == self.ax else self.color
216+
if c != self.ax.get_facecolor():
220217
self.ax.set_facecolor(c)
221-
self._lastcolor = c
222218
if self.drawon:
223219
self.ax.figure.canvas.draw()
224220

0 commit comments

Comments
 (0)