Fix resize-os-window slightly incorrect on high DPI

Caused by premature clamping of a floating point number
This commit is contained in:
Kovid Goyal 2021-10-12 19:40:02 +05:30
parent a3717436b6
commit 8057c420d9
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 3 deletions

View File

@ -90,6 +90,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- macOS: Fix :opt:`resize_in_steps` not working correctly on high DPI screens
(:iss:`4114`)
- Fix the :program:`resize OS Windows <kitty @ resize-os-window>` setting a
slightly incorrect size on high DPI screens (:iss:`4114`)
0.23.1 [2021-08-17]
----------------------

View File

@ -715,11 +715,11 @@ def get_new_os_window_size(
if unit == 'cells':
cw = metrics['cell_width']
ch = metrics['cell_height']
if has_window_scaling:
cw = int(cw / metrics['xscale'])
ch = int(ch / metrics['yscale'])
width *= cw
height *= ch
if has_window_scaling:
width = round(width / metrics['xscale'])
height = round(height / metrics['yscale'])
if incremental:
w = metrics['width'] + width
h = metrics['height'] + height