Skip to content
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

Catch IndexError on mouse move #1143

Merged
merged 1 commit into from
Jan 28, 2022

Conversation

psavery
Copy link
Collaborator

@psavery psavery commented Jan 28, 2022

This error would happen occasionally in the cartesian and polar views
when the mouse is moved close to an edge of the canvas. It appears that
it was happening because the x_data for the event was slightly over the
max, which led to an out-of-bounds index being computed. This would
then result in an IndexError.

This error is relatively harmless, but it may worry users, so catch it
to prevent it from appearing.

I believe this error has been happening more commonly for me after #1138 was merged.

This error would happen occasionally in the cartesian and polar views
when the mouse is moved close to an edge of the canvas. It appears that
it was happening because the x_data for the event was slightly over the
max, which led to an out-of-bounds index being computed. This would
then result in an IndexError.

This error is relatively harmless, but it may worry users, so catch it
to prevent it from appearing.

Signed-off-by: Patrick Avery <[email protected]>
@psavery psavery requested a review from bnmajor January 28, 2022 12:54
Copy link
Collaborator

@bnmajor bnmajor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not able to replicate the error myself but this looks good!

@psavery psavery merged commit aea3f2b into HEXRD:master Jan 28, 2022
@psavery psavery deleted the catch-mouse-move-index-error branch January 28, 2022 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants