FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Convert macosx backend to use device_pixel_ratio by QuLogic · Pull Request #21365 · matplotlib/matplotlib · GitHub

Repository navigation

Convert macosx backend to use device_pixel_ratio - #21365

Merged
tacaswell merged 1 commit into
matplotlib:mainfrom
QuLogic:macosx-device-scale
Oct 20, 2021
Merged

tacaswell merged 1 commit into
matplotlib:mainfrom
QuLogic:macosx-device-scale

Conversation

QuLogic commented Oct 15, 2021

Copy link
Copy Markdown
Member

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

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • [n/a] New features are documented, with examples if plot related.
  • [n/a] Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • [n/a] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [n/a] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

QuLogic added this to the v3.5.0 milestone Oct 15, 2021

greglucas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

QuLogic commented Oct 15, 2021

Copy link
Copy Markdown
Member Author

A few other tests I should have mentioned (that should only need checking on a Retina display):

  • The mouse cursor display in the toolbar message should be reasonable
  • The zoom select box should match the cursor position
  • Saving a figure from the toolbar button should use the original DPI, and not be zoomed in double size (I think this was fixed for all backends in another PR, but don't know for sure with macosx).

Copy link
Copy Markdown
Contributor

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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL