fix small error in poly_editor example#7354
Merged
tacaswell merged 2 commits intomatplotlib:masterfrom Oct 27, 2016
Merged
Conversation
* if vertex 0 is grabbed, the last point of the poly should be updated as well
Member
|
Is it ever possible to grab the last point (and thus require the opposite fix)? |
Author
|
@QuLogic good point. I have never run into that issue myself as it seems it always renders the zeroth vertex directly over the last vertex. But it couldn't hurt to handle that just in case. |
…as they overlap * this case is likely to not occur since it seems that the first vertex handle is rendered over the last vertex handle
phobson
reviewed
Oct 27, 2016
| self.poly.xy[self._ind] = x, y | ||
| if self._ind == 0: | ||
| self.poly.xy[-1] = x, y | ||
| elif self._ind == len(self.poly.xy) - 1: |
Member
There was a problem hiding this comment.
does it make senses to check if if self._ind == -1?
I wouldn't think that it would ever come up, but I'm not good with the interactive stuff.
QuLogic
approved these changes
Oct 27, 2016
tacaswell
added a commit
that referenced
this pull request
Oct 27, 2016
DOC: fix small error in poly_editor example
Member
Member
|
Once CI finishes on the master branch, these changes will show up at http://matplotlib.org/devdocs/examples/event_handling/poly_editor.html |
Author
|
@tacaswell It is indeed! Thank you for the welcome and for the hard work you're all putting into matplotlib, it's a great tool. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If you grab the 0 vertex, the last vertex is left behind:
if you grab it, it looks like like a separate line segment:
after the fix: