When calculating body font size clear cache if window.devicePixelRatio changes

This commit is contained in:
Kovid Goyal 2025-02-08 09:12:36 +05:30
parent bd10c248a0
commit 88f5310317
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -163,7 +163,9 @@ def show_controls_help():
def body_font_size():
ans = body_font_size.ans
if not ans:
dpr = body_font_size.dpr
if not ans or window.devicePixelRatio is not dpr:
body_font_size.dpr = window.devicePixelRatio
q = window.getComputedStyle(document.body).fontSize
if q and q.endsWith('px'):
q = parseInt(q)