X Tutup
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions lib/matplotlib/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
except ImportError:
# LPy workaround
from fractions import gcd
import warnings

import numpy as np
import matplotlib as mpl
Expand Down Expand Up @@ -363,19 +362,11 @@ def contains(self, mouseevent):
if not self.get_visible():
return False, {}

if self._picker is True: # the Boolean constant, not just nonzero or 1
pickradius = self._pickradius
else:
try:
pickradius = float(self._picker)
except TypeError:
# This should not happen if "contains" is called via
# pick, the normal route; the check is here in case
# it is called through some unanticipated route.
warnings.warn(
"Collection picker %s could not be converted to float"
% self._picker)
pickradius = self._pickradius
pickradius = (
float(self._picker)
if cbook.is_numlike(self._picker) and
self._picker is not True # the bool, not just nonzero or 1
else self._pickradius)

transform, transOffset, offsets, paths = self._prepare_points()

Expand Down
X Tutup