Skip to content

Commit 8cff894

Browse files
committed
figure_enter_event uses now LocationEvent instead of Event.
This is now consistent with the documentation: https://matplotlib.org/users/event_handling.html
1 parent d2e68ff commit 8cff894

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2010,8 +2010,12 @@ def enter_notify_event(self, guiEvent=None, xy=None):
20102010
if xy is not None:
20112011
x, y = xy
20122012
self._lastx, self._lasty = x, y
2013+
else:
2014+
x = None
2015+
y = None
2016+
warn_deprecated('2.2', 'enter_notify_event expects a location but your backend did not pass one.')
20132017

2014-
event = Event('figure_enter_event', self, guiEvent)
2018+
event = LocationEvent('figure_enter_event', self, x, y, guiEvent)
20152019
self.callbacks.process('figure_enter_event', event)
20162020

20172021
@cbook.deprecated("2.1")

0 commit comments

Comments
 (0)