Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4d4b653

Browse filesBrowse files
committed
Changed to single line with comment.
1 parent 59380fa commit 4d4b653
Copy full SHA for 4d4b653

File tree

Expand file treeCollapse file tree

1 file changed

+1
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-5
lines changed

‎lib/matplotlib/backends/backend_qt5.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_qt5.py
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,7 @@ def _update_figure_dpi(self):
269269
def _dpi_ratio(self):
270270
# Not available on Qt4 or some older Qt5.
271271
try:
272-
ratio = self.devicePixelRatio()
273-
if ratio == 0:
274-
return 1
275-
else:
276-
return ratio
272+
return self.devicePixelRatio() or 1 # can be 0 in rare cases
277273
except AttributeError:
278274
return 1
279275

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.