Use Math.round() for font size incrememnt

Slightly improves #2105390
This commit is contained in:
Kovid Goyal 2025-03-30 10:20:40 +05:30
parent 410ee5fd29
commit 00ba3b8066
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -52,7 +52,7 @@ def change_font_size_by(frac):
amt = sz * frac amt = sz * frac
if abs(amt) < 1: if abs(amt) < 1:
amt = -1 if amt < 0 else 1 amt = -1 if amt < 0 else 1
nsz = int(sz + amt) nsz = Math.round(sz + amt)
nsz = max(MIN_FONT_SIZE, min(nsz, MAX_FONT_SIZE)) nsz = max(MIN_FONT_SIZE, min(nsz, MAX_FONT_SIZE))
change_font_size(nsz) change_font_size(nsz)