8000 add more comments and update code based on suggestion · matplotlib/matplotlib@e885826 · GitHub
[go: up one dir, main page]

Skip to content

Commit e885826

Browse files
committed
add more comments and update code based on suggestion
1 parent 66403eb commit e885826

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/patches.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ def contains(self, mouseevent, radius=None):
140140
radius = self._process_radius(radius)
141141
codes = self.get_path().codes
142142
vertices = self.get_path().vertices
143-
idxs, = np.nonzero(codes == 1)
143+
# if the current path is concatenated by multiple sub paths.
144+
# get the indexes of the starting code(MOVETO) of all sub paths
145+
idxs, = np.where(codes == 1)
144146
# Don't split before the first MOVETO.
145147
idxs = idxs[1:]
146148
return any(

0 commit comments

Comments
 (0)
0