mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 01:05:48 +02:00
Fix incorrect handling of zero extra pixel offset
This commit is contained in:
@@ -143,10 +143,12 @@ def fit_image(width, height, pwidth, pheight):
|
||||
def calculate_in_cell_x_offset(width, cell_width, align):
|
||||
if align == 'left':
|
||||
return 0
|
||||
extra_pixels = cell_width - (width % cell_width)
|
||||
extra_pixels = width % cell_width
|
||||
if not extra_pixels:
|
||||
return 0
|
||||
if align == 'right':
|
||||
return extra_pixels
|
||||
return extra_pixels // 2
|
||||
return cell_width - extra_pixels
|
||||
return (cell_width - extra_pixels) // 2
|
||||
|
||||
|
||||
def set_cursor(cmd, width, height, align):
|
||||
|
||||
Reference in New Issue
Block a user