Adding the artist data on mouse move event message#7102
Adding the artist data on mouse move event message#7102tacaswell merged 2 commits intomatplotlib:masterfrom
Conversation
lib/matplotlib/backend_tools.py
Outdated
| if a.contains(event) and a.get_visible()] | ||
|
|
||
| if artists: | ||
| a = max(enumerate(artists), key=lambda x: x[1].zorder)[1] |
There was a problem hiding this comment.
Is not a = max(artists, key=lambda x: x.zorder) is the same as this?
There was a problem hiding this comment.
My guess is that it is but to be honest, I didn't check, I just copy/paste from backend_bases.py
There was a problem hiding this comment.
@tacaswell as you are the original author of that line, do you see a problem with @Kojoley suggestion?
There was a problem hiding this comment.
I looked at this earlier today and have a memory of doing it this way intentionally, but no longer remember the why.
The discussion at https://github.com/matplotlib/matplotlib/pull/4813/files is not enlightening and I can not even claim I just carried through some older code.
I think making that change is fine.
|
The failures are not related |
|
@Kojoley I simplified as suggested. It works fine on my side |
ENH: Adding the artist data on mouse move event message
|
backported to v2.x as f52af63 |
In the tools we didn't add the artist data to the message on mouse move event.
Also added a small check, for
get_visibleartist list, this is because if the artist is not visible we shouldn't show its data