File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818except ImportError :
1919 # LPy workaround
2020 from fractions import gcd
21- import warnings
2221
2322import numpy as np
2423import matplotlib as mpl
@@ -363,19 +362,11 @@ def contains(self, mouseevent):
363362 if not self .get_visible ():
364363 return False , {}
365364
366- if self ._picker is True : # the Boolean constant, not just nonzero or 1
367- pickradius = self ._pickradius
368- else :
369- try :
370- pickradius = float (self ._picker )
371- except TypeError :
372- # This should not happen if "contains" is called via
373- # pick, the normal route; the check is here in case
374- # it is called through some unanticipated route.
375- warnings .warn (
376- "Collection picker %s could not be converted to float"
377- % self ._picker )
378- pickradius = self ._pickradius
365+ pickradius = (
366+ float (self ._picker )
367+ if cbook .is_numlike (self ._picker ) and
368+ self ._picker is not True # the bool, not just nonzero or 1
369+ else self ._pickradius )
379370
380371 transform , transOffset , offsets , paths = self ._prepare_points ()
381372
You can’t perform that action at this time.
0 commit comments