8000 Backport PR #18304: Fix canvas redraws during motion in figures with … · matplotlib/matplotlib@5e82558 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5e82558

Browse files
yoda-vidmeeseeksmachine
authored andcommitted
Backport PR #18304: Fix canvas redraws during motion in figures with a Button or TextBox
1 parent 355fac9 commit 5e82558

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)
0