Skip to content

Commit bd6f39b

Browse files
authored
Merge pull request matplotlib#18309 from meeseeksmachine/auto-backport-of-pr-18304-on-v3.3.x
Backport PR matplotlib#18304 on branch v3.3.x (Fix canvas redraws during motion in figures with a Button or TextBox)
2 parents 355fac9 + 5e82558 commit bd6f39b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/widgets.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import numpy as np
1717

1818
import matplotlib as mpl
19-
from . import cbook, ticker
19+
from . import cbook, colors, ticker
2020
from .lines import Line2D
2121
from .patches import Circle, Rectangle, Ellipse
2222
from .transforms import blended_transform_factory
@@ -211,7 +211,7 @@ def _motion(self, event):
211211
if self.ignore(event):
212212
return
213213
c = self.hovercolor if event.inaxes == self.ax else self.color
214-
if c != self.ax.get_facecolor():
214+
if not colors.same_color(c, self.ax.get_facecolor()):
215215
self.ax.set_facecolor(c)
216216
if self.drawon:
217217
self.ax.figure.canvas.draw()
@@ -908,7 +908,7 @@ def _motion(self, event):
908908
if self.ignore(event):
909909
return
910910
c = self.hovercolor if event.inaxes == self.ax else self.color
911-
if c != self.ax.get_facecolor():
911+
if not colors.same_color(c, self.ax.get_facecolor()):
912912
self.ax.set_facecolor(c)
913913
if self.drawon:
914914
self.ax.figure.canvas.draw()

0 commit comments

Comments
 (0)