Skip to content

Commit

Permalink
Fix dpi calculation which caused problems with Linux and several moni…
Browse files Browse the repository at this point in the history
…tors
  • Loading branch information
chges100 committed May 5, 2022
1 parent 6cc8794 commit 458f6a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ui_scaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def get_scaling_factor(master):
except:
# ... if that fails try the first one in the list
monitor = monitors[0]
dpi = monitor.width / (master.winfo_screenmmwidth() / 24.0)

dpi = monitor.width / (monitor.width_mm / 24.0)
scaling_factor = dpi / 72.0
except BaseException as e:
print("WARNING: could not calculate monitor dpi:", e)
Expand Down

0 comments on commit 458f6a8

Please sign in to comment.