-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Added the "cleared" method to Path, and updated the path module's documentation. #2011
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
Conversation
Returns: | ||
A (vertices, codes) tuple, where vertices is an array of | ||
coordinates, and codes is an array of path codes. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might as well do this in numpydoc format as well, while we're at it.
Ok. Think this is now ready @mdboom. |
@@ -75,12 +86,16 @@ class Path(object): | |||
LINETO = 2 # 1 vertex | |||
CURVE3 = 3 # 2 vertices | |||
CURVE4 = 4 # 3 vertices | |||
CLOSEPOLY = 0x4f # 1 vertex | |||
CLOSEPOLY = 79 # 1 vertex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep this as it was -- I know it doesn't really matter, but there are some tricks used to detect the end of paths that are made more obvious when you think of it in hex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but there are some tricks used to detect the end of paths that are made more obvious when you think of it in hex
For whom? I can see the benefit for developers, but not for everyday users. I'd be happy to add a comment here to jig the readers memory, if that would suffice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok -- probably simplest to leave it as a (base 10) number, then. A comment here doesn't make sense either.
I still think we should have |
The two cases I can envisage with cleared both just use the codes and verts. That said, I'm happy enough to compromise and have implemented a fast constructor for Path. Was that the kind of thing you had in mind? |
Yes -- that's basically what I had in mind. I think that's handy. There may be other cases in there where this should be used instead of the constructor, but that can wait for another PR. |
Nice. I've added a commit. I expect to have to rebase this PR after the deprecations PR gets merged. |
No worries. Having your invaluable feedback on this module has been great. I'll rebase now. |
Ok. Once travis does its thing, lets merge 😄 |
Other than the spurious test failiure from master, the tests are passing with this PR. |
Added the "cleared" method to Path, and updated the path module's documentation.
No description provided.