Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Improve rubberband rendering in wx and tk#23985
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
[(x0, y0, x1, y0), (x1, y0, x1, y1), | ||
(x0, y0, x0, y1), (x0, y1, x1, y1)], | ||
wx.Pen('BLACK', 1, wx.PENSTYLE_SHORT_DASH)) | ||
x0, y0, x1, y1 = map(round, self._rubberband_rect) |
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.
Earlier it was possible that the left and bottom bounds could be one pixel off asint
truncates. Usinground
seems to improve the situation, at least based on practical tests.
I manually tested tk. |
…985-on-v3.6.xBackport PR#23985 on branch v3.6.x (Improve rubberband rendering in wx and tk)
PR Summary
Closes#23969 (as there is a separate OSX issue#23777)
Draw a solid white rectangle and then add a dashed black rectangle so that it works on both light and dark backgrounds. For the tk backend it messes up the deprecated
lastrect
as bit since it only can contain one of the two rectangles. Not sure whatlastrect
is used for. If it is only to get the position it should be OK, but if it is to possibly modify the rectangle it may not work.No obvious way to test it in the CI.
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).