-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Qt5Agg HiDPI support #7507
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
Qt5Agg HiDPI support #7507
Conversation
Seems to work nicely! |
There is a bug with |
I'm not seeing the WebAgg backend (#5383) do anything to handle that either; is it really needed? |
The |
On resize events, we scale the logical pixels to physical pixels and then calculate inches via the scaled DPI, so I'm pretty sure Looking at the So I'm wondering whether this bug occurs with true HiDPI displays? Is it a bug in Qt or just Qt's |
The renderer and backing QPixmap use doubled (or whatever) pixels, but the painter continues to use logical pixels for positioning.
Found QTBUG-51899 and QTBUG-53389, so this is not a bug in the matplotlib code. |
This looks good. I am not very familiar with these backends, so another pair of eye should look at this PR. |
Works for me as expected. Would be cool to have this in the final v2.0 already. |
Tested it too and seems to work fine. The only question is if it's to late to merge into 2.0 @tacaswell |
If the underlying canvas as a `_dpi_ratio`, scale the dpi before computing the new size.
This completes the work by @piannucci in #6389. Scaling is necessary on the figure DPI, and inverse scaling on rubberband and blitting locations.
I don't have a HiDPI display, but I tested by setting
QT_SCALE_FACTOR=2
. There is one bug with resizing if I use the grip in the status bar because it produces the wrong size. I'm not sure where that is created, so I haven't fixed it yet. Resizing using the OS's size works fine.Ping @tacaswell, @astrofrog, @adrn, and @jenshnielsen who appear to have HiDPI screens based on other issues.