From 01afbdaf9d9983b86ffd5700462bdc4bc5e04334 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 14 Apr 2020 00:34:17 -0400 Subject: [PATCH] Fix Button widget motion callback. --- lib/matplotlib/widgets.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index 544f8d1f1c49..1a03d34633c3 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -212,13 +212,9 @@ def _release(self, event): def _motion(self, event): if self.ignore(event): return - if event.inaxes == self.ax: - c = self.hovercolor - else: - c = self.color - if c != self._lastcolor: + c = self.hovercolor if event.inaxes == self.ax else self.color + if c != self.ax.get_facecolor(): self.ax.set_facecolor(c) - self._lastcolor = c if self.drawon: self.ax.figure.canvas.draw()