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.
Issue number of the reported bug or feature request: #1048
Describe your changes
This adds an EllipseBrushSelector, which can be used as circular selector. To enforce a circular selector, put pixel_aspect=1. Note that this means the aspect is 1 in pixel coordinates, another requirement that could be added is having an aspect ratio in data coordinates (domain). This PR does not address that, and I think both can be orthogonal in use cases.
Testing performed
All operations are testing in the test framework.
Issue
Reshaping may change the aspect ratio of the ellipse (as visible in the demo), due to the implementation of how reshaping/dragging is implemented. We use the same code as the brushing, which assuming if you move X pixels in the x-direction, and Y pixels in the y-direction, you want an ellipse of aspect ratio X/Y. While actually when dragging the border, you probably want to calculate the 'angle' (more formally the eccentric anomaly https://en.wikipedia.org/wiki/Ellipse#Parametric_representation) and use that as a 'grab' point. I am not sure yet how this should be implemented, or what 'feels' natural.
Ideas are welcome: @astrofrog @SylvainCorlay @martinRenou
Demo