-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix rubberbanding on wx+py3.10. #21990
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
Added a minimal smoketest for draw_rubberband. |
Locally (Arch standard packages), it otherwise fails with File "/usr/lib/python3.10/site-packages/wx/core.py", line 1098, in _DC_DrawLineList return self._DrawLineList(lines, pens, []) TypeError: 'numpy.float64' object cannot be interpreted as an integer
@@ -128,6 +128,8 @@ def check_alt_backend(alt_backend): | |||
"matplotlib.backends.backend_{}".format(backend)) | |||
|
|||
ax.plot([0, 1], [2, 3]) | |||
if fig.canvas.toolbar: # i.e toolbar2. | |||
fig.canvas.toolbar.draw_rubberband(None, 1., 1, 2., 2) |
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.
codecov claims this line isn't being tested - is that a CI issue or is the if statement never being executed anywhere?
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.
At least locally, I can confirm that this is indeed executed...
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 line is run for all backends, and we skip a few, so it seems to be referring to that.
…990-on-v3.5.x Backport PR #21990 on branch v3.5.x (Fix rubberbanding on wx+py3.10.)
Locally (Arch standard packages), it otherwise fails with
File "/usr/lib/python3.10/site-packages/wx/core.py", line 1098, in _DC_DrawLineList
return self._DrawLineList(lines, pens, [])
TypeError: 'numpy.float64' object cannot be interpreted as an integer
Likely the same root cause as #19395.
PR Summary
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).