Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bab5c6d

Browse files
author
pkienzle
committed
more concise Axes.contains() implementation
svn path=/trunk/matplotlib/; revision=3529
1 parent 40548cf commit bab5c6d

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

lib/matplotlib/axes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,8 +1911,7 @@ def contains(self,mouseevent):
19111911
"""
19121912
if callable(self._contains): return self._contains(self,mouseevent)
19131913

1914-
x,y = self.axes.transAxes.inverse_xy_tup((mouseevent.x,mouseevent.y))
1915-
inside = x>=0 and x<=1 and y>=0 and y<=1
1914+
inside = self.bbox.contains(mouseevent.x,mouseevent.y)
19161915
return inside,{}
19171916

19181917
def pick(self,*args):

0 commit comments

Comments
 (0)