Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0b64cc1 + 834f4cb commit 963506fCopy full SHA for 963506f
1 file changed
lib/matplotlib/text.py
@@ -211,7 +211,16 @@ def contains(self,mouseevent):
211
212
x, y = mouseevent.x, mouseevent.y
213
inside = (l <= x <= r and b <= y <= t)
214
- return inside, {}
+ cattr = {}
215
+
216
+ # if the text has a surrounding patch, also check containment for it,
217
+ # and merge the results with the results for the text.
218
+ if self._bbox_patch:
219
+ patch_inside, patch_cattr = self._bbox_patch.contains(mouseevent)
220
+ inside = inside or patch_inside
221
+ cattr["bbox_patch"] = patch_cattr
222
223
+ return inside, cattr
224
225
def _get_xy_display(self):
226
'get the (possibly unit converted) transformed x, y in display coords'
0 commit comments