-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Convert macosx backend to use device_pixel_ratio #21365
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
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 works as expected for me.
I also rebased this onto #21212 and both work as expected now, with this fixing the issue that cropped up over there on macosx as well.
A few other tests I should have mentioned (that should only need checking on a Retina display):
|
I just tested all of those cases and they all produce the expected output for me. These two PRs work well with the mixed DPI cases for me locally. |
This was not originally implemented in matplotlib#19126, but causes some inconsistencies with other backends. This also sets the initial scale as implemented in matplotlib#18274.
e7c5fe7
to
ab61cbe
Compare
…365-on-v3.5.x Backport PR #21365 on branch v3.5.x (Convert macosx backend to use device_pixel_ratio)
PR Summary
This was not originally implemented in #19126, but causes some inconsistencies with other backends.
This also sets the initial scale as implemented in #18274.
I tested this out on MacStadium, but it only has a single display which isn't Retina. If you have a Retina display, you can check that the window is correctly double-sized.
If you have two displays, with mixed DPI, then you can check the full functionality. If you create a window on one display, and move it to the other, it should shrink/grow accordingly. A test I do is to start an interpreter, go to interactive mode, and open a figure on each display (on mutter, where your mouse is determines where a window first appears; I don't know if that's the same on macOS). Then you can drag one to the other display, and if resized correctly, they should match each other. Additionally, call
fig.set_size_inches(3, 3)
on both while on different displays, and bringing them together should be the same size.PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).