Fix resize-os-window slightly incorrect on high DPI
Caused by premature clamping of a floating point number
This commit is contained in:
parent
a3717436b6
commit
8057c420d9
@ -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]
|
||||
----------------------
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user