Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bd6f39b

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

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed

‎lib/matplotlib/widgets.py

Copy file name to clipboardExpand all lines: lib/matplotlib/widgets.py
+3-3Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.