-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
fix FancyArrowPatch picker fails depending on arrowstyle #10776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,9 +130,18 @@ def contains(self, mouseevent, radius=None): | |
if callable(self._contains): | ||
return self._contains(self, mouseevent) | ||
radius = self._process_radius(radius) | ||
inside = self.get_path().contains_point( | ||
(mouseevent.x, mouseevent.y), self.get_transform(), radius) | ||
return inside, {} | ||
codes = self.get_path().codes | ||
vertices = self.get_path().vertices | ||
# if the current path is concatenated by multiple sub paths. | ||
# get the indexes of the starting code(MOVETO) of all sub paths | ||
idxs, = np.where(codes == 1) | ||
# Don't split before the first MOVETO. | ||
idxs = idxs[1:] | ||
return any( | ||
subpath.contains_point( | ||
(mouseevent.x, mouseevent.y), self.get_transform(), radius) | ||
for subpath in map( | ||
Path, np.split(vertices, idxs), np.split(codes, idxs))), {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I finally see what this is doing, but, can this be deconvolved to ease in maintenance and understanding? Other devs are free to approve if they are OK with this, and its just my python ignorance, but its not the clearest return statement in the code base. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you reformat this to
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is OK to leave as-is. |
||
|
||
def contains_point(self, point, radius=None): | ||
""" | ||
|
Uh oh!
There was an error while loading. Please reload this page.