Repository navigation
Commit cfff335
committed
FIX: Qt5 account for dpiratio as early as possible
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 #87171 parent f8df71b commit cfff335
2 files changed
Lines changed: 7 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
185 | 189 | | |
186 | 190 | | |
| 191 | + | |
187 | 192 | | |
188 | 193 | | |
189 | 194 | | |
| |||
192 | 197 | | |
193 | 198 | | |
194 | 199 | | |
| 200 | + | |
| 201 | + | |
195 | 202 | | |
196 | 203 | | |
197 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | 193 | | |
205 | 194 | | |
206 | 195 | | |
| |||
0 commit comments