-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Rectangle Selector Upgrade #3937
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
Rectangle Selector Upgrade #3937
Conversation
self.eventpress.xdata, self.eventpress.ydata = ( | ||
self._get_data(event)) | ||
return True | ||
return False |
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.
This should maintain the return behaviour.
The test failures look like they are coming out of |
@tacaswell I believe I addressed your concern about return values. |
@@ -99,11 +110,98 @@ def test_rectangle_selector(): | |||
check_rectangle(rectprops=dict(fill=True)) | |||
|
|||
|
|||
def test_ellipse(): |
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.
These need @cleanup
decorators, I suspect that is related to the seemingly un-related failures as the global state of pyplot leaks across tests.
Down to pep8 issues:
|
This fell off the bottom of my internal FILO buffer, what is the state of this? |
The last few commits were some cleanup as a result of using this branch to make the contrast selector tool. I'd say its done and ready. |
Current priority is getting 1.4.3rc1 cut, hopefully I will be able to loop back to the master branch stuff 'soon'. |
No problemo. |
@blink1073 it's been a long time, but did you test this changes with the new |
@fariza, I just did a rebase and played with the |
7a30732
to
f73682f
Compare
My concern comes from #1368 |
That makes sense to me. |
I just tried and I noticed a little change in the behaviour. |
Sorry, I just read the description. |
@fariza, assuming @tacaswell agrees with the new behavior, I can update the example. One would clear the selection by clicking outside of the selection (without dragging). |
Wouldn't it be better to add a kwarg to persist after release? |
I agree with both statements: preserve the previous behavior and allow the escape key to clear the selection. |
Ah, I remember now. It is "control" if it is the only key and "ctrl" in a key combination. I can just account for that one special case. |
How about a |
Interesting idea. It would help keep the constructor from getting cluttered. On Tue, Aug 25, 2015 at 8:32 AM, Steven Silvester [email protected]
|
@blink1073 I like the @WeatherGod @tacaswell There are several places around the code, that we hardcoded |
I settled on |
Both test failures looked like the tex related transients. @fariza I agree re the need for a centralized way to manage key event bindings, but want to punt on that for this PR. @WeatherGod If you are happy, please merge this. |
self.connect_default_events() | ||
|
||
self.state_modifier_keys = dict(move=' ', clear='escape', | ||
square='shift', center='ctrl') |
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.
I like this. It also helps to keep all the possible actions and associated keys in one place.
ENH: Rectangle Selector Upgrade
@blink1073 Can you add a whats_new in a new PR? |
@WeatherGod Merged this as no activity for a week, we can iterate in smaller PRs if needed. |
@tacaswell, indeed. Sorry for the silence on my end as other things came up. Unfortunately, I don't see much relief in sight over the next few weeks. |
@tacaswell, which one would you like next? I was thinking |
LassoSelector sounds good to me. On Tue, Sep 8, 2015 at 9:33 AM Steven Silvester [email protected]
|
|
This builds on #3486 and #3502.
This improves the
RectangleSelector
and adds anEllipseSelector
with minimal code differences.Improvements:
The API is the same (unless using the modifier keys), but we add the
interactive
keyword arg to enable the new behavior.