Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b29a3fd

Browse files
QuLogicksunden
authored andcommitted
Backport PR matplotlib#30345: qt: Use better devicePixelRatio event to refresh scaling
1 parent 0bacb2e commit b29a3fd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/tests/test_backend_qt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def on_key_press(event):
132132

133133

134134
@pytest.mark.backend('QtAgg', skip_on_importerror=True)
135-
def test_device_pixel_ratio_change():
135+
def test_device_pixel_ratio_change(qt_core):
136136
"""
137137
Make sure that if the pixel ratio changes, the figure dpi changes but the
138138
widget remains the same logical size.
@@ -172,6 +172,7 @@ def set_device_pixel_ratio(ratio):
172172
qt_canvas.draw()
173173
qt_canvas.flush_events()
174174
size = qt_canvas.size()
175+
set_device_pixel_ratio(3)
175176

176177
options = [
177178
(None, 360, 1800, 720), # Use ratio at startup time.

0 commit comments

Comments
 (0)