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

Skip to content

Commit f6b8891

Browse files
authored
Merge pull request #17133 from QuLogic/fix-button-widget
Fix Button widget motion callback.
2 parents 717d1fa + 01afbda commit f6b8891

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
@@ -210,13 +210,9 @@ def _release(self, event):
210210
def _motion(self, event):
211211
if self.ignore(event):
212212
return
213-
if event.inaxes == self.ax:
214-
c = self.hovercolor
215-
else:
216-
c = self.color
217-
if c != self._lastcolor:
213+
c = self.hovercolor if event.inaxes == self.ax else self.color
214+
if c != self.ax.get_facecolor():
218215
self.ax.set_facecolor(c)
219-
self._lastcolor = c
220216
if self.drawon:
221217
self.ax.figure.canvas.draw()
222218

0 commit comments

Comments
 (0)