| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Previously, the canvas size would get set to too small because - in the FigureCanvasQt.__init__ `get_width_height` is used to set the initial size of the canvas - `get_width_height` accounts for the dpiratio, but it has not been multiplied up yet so it reports half the size it should - this get propagated back down into the Figure object in the resize method - the dpi is then scaled up This fix - moves adding the `_original_dpi` attribute to the Figure as soon as possible in the base __init__ - calls `_update_dpi` before asking the figure how big it is Closes matplotlib#8717
|
I'll test this out this afternoon with my mixed resolution screen set-up |
Sorry, something went wrong.
|
I won't be able to do proper reviews in the coming days due to spotty internet access, so please carry on without me. If someone is really courageous they can check how PRs such as this one interact with #8771 (cairo/qt5) and/or try to fix #8659 (causing some Qt-related tests to be skipped in some cases). |
Sorry, something went wrong.
There was a problem hiding this comment.
This looks good and still works for me. Stylistically I find it unusual to have _update_figure_dpi before __init__ in FigureCanvasQT, but this is ultra-minor.
Sorry, something went wrong.
The values in the test were the buggy values. We expect a (5, 2) in figure at 120 dpi to be (600, 240) screen pixels.
|
Turns out the number in the test were low due to the bug that this is fixing! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Previously, the canvas size would get set to too small because
the initial size of the canvas
multiplied up yet so it reports half the size it should
method
This fix
soon as possible in the base init
attn @djpine