Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e885826

Browse filesBrowse files
committed
add more comments and update code based on suggestion
1 parent 66403eb commit e885826
Copy full SHA for e885826

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed

‎lib/matplotlib/patches.py

Copy file name to clipboardExpand all lines: lib/matplotlib/patches.py
+3-1Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.