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 f3d907c

Browse filesBrowse files
authored
Merge pull request #25557 from anntzer/en
Rename parameter of Annotation.contains and Legend.contains.
2 parents a9afe5b + b6112c3 commit f3d907c
Copy full SHA for f3d907c

File tree

Expand file treeCollapse file tree

3 files changed

+11
-6
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+11
-6
lines changed
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The parameter of ``Annotation.contains`` and ``Legend.contains`` is renamed to *mouseevent*
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
... consistently with `.Artist.contains`.

‎lib/matplotlib/legend.py

Copy file name to clipboardExpand all lines: lib/matplotlib/legend.py
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,8 +1173,9 @@ def _find_best_position(self, width, height, renderer, consider=None):
11731173

11741174
return l, b
11751175

1176-
def contains(self, event):
1177-
return self.legendPatch.contains(event)
1176+
@_api.rename_parameter("3.8", "event", "mouseevent")
1177+
def contains(self, mouseevent):
1178+
return self.legendPatch.contains(mouseevent)
11781179

11791180
def set_draggable(self, state, use_blit=False, update='loc'):
11801181
"""

‎lib/matplotlib/text.py

Copy file name to clipboardExpand all lines: lib/matplotlib/text.py
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,12 +1848,13 @@ def transform(renderer) -> Transform
18481848
# Must come last, as some kwargs may be propagated to arrow_patch.
18491849
Text.__init__(self, x, y, text, **kwargs)
18501850

1851-
def contains(self, event):
1852-
if self._different_canvas(event):
1851+
@_api.rename_parameter("3.8", "event", "mouseevent")
1852+
def contains(self, mouseevent):
1853+
if self._different_canvas(mouseevent):
18531854
return False, {}
1854-
contains, tinfo = Text.contains(self, event)
1855+
contains, tinfo = Text.contains(self, mouseevent)
18551856
if self.arrow_patch is not None:
1856-
in_patch, _ = self.arrow_patch.contains(event)
1857+
in_patch, _ = self.arrow_patch.contains(mouseevent)
18571858
contains = contains or in_patch
18581859
return contains, tinfo
18591860

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.