-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
figure_enter_event uses now LocationEvent instead of Event. Fix issue #9812. #9814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -299,7 +299,8 @@ def get_width_height(self): | |
return int(w / self._dpi_ratio), int(h / self._dpi_ratio) | ||
|
||
def enterEvent(self, event): | ||
FigureCanvasBase.enter_notify_event(self, guiEvent=event) | ||
x, y = self.mouseEventCoords(event.pos()) | ||
FigureCanvasBase.enter_notify_event(self, guiEvent=event, xy=(x, y)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can just be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could do but that would break some inconsistency with the other event as well. For example
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair. I suppose those could also all be changed to normal method calls, but that is beyond the scope of this PR. |
||
|
||
def leaveEvent(self, event): | ||
QtWidgets.QApplication.restoreOverrideCursor() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1053,7 +1053,10 @@ def _onLeave(self, evt): | |
|
||
def _onEnter(self, evt): | ||
"""Mouse has entered the window.""" | ||
FigureCanvasBase.enter_notify_event(self, guiEvent=evt) | ||
x = evt.GetX() | ||
y = self.figure.bbox.height - evt.GetY() | ||
evt.Skip() | ||
FigureCanvasBase.enter_notify_event(self, guiEvent=evt, xy=(x, y)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can also just be |
||
|
||
|
||
class FigureCanvasWx(_FigureCanvasWxBase): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a warning here like
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cbook.warn_deprecated?