mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
Remove unused code
icat already scales images to fit the screen in process_image() so dont have to consider the case of the image being wider than the screen in set_cursor()
This commit is contained in:
@@ -22,7 +22,7 @@ from kitty.guess_mime_type import guess_type
|
|||||||
from kitty.types import run_once
|
from kitty.types import run_once
|
||||||
from kitty.typing import GRT_f, GRT_t
|
from kitty.typing import GRT_f, GRT_t
|
||||||
from kitty.utils import (
|
from kitty.utils import (
|
||||||
TTYIO, ScreenSize, ScreenSizeGetter, fit_image, screen_size_function
|
TTYIO, ScreenSize, ScreenSizeGetter, screen_size_function
|
||||||
)
|
)
|
||||||
|
|
||||||
from ..tui.images import (
|
from ..tui.images import (
|
||||||
@@ -167,12 +167,6 @@ def set_cursor(cmd: GraphicsCommand, width: int, height: int, align: str) -> Non
|
|||||||
ss = get_screen_size()
|
ss = get_screen_size()
|
||||||
cw = int(ss.width / ss.cols)
|
cw = int(ss.width / ss.cols)
|
||||||
num_of_cells_needed = int(ceil(width / cw))
|
num_of_cells_needed = int(ceil(width / cw))
|
||||||
if num_of_cells_needed > ss.cols:
|
|
||||||
w, h = fit_image(width, height, ss.width, height)
|
|
||||||
ch = int(ss.height / ss.rows)
|
|
||||||
num_of_rows_needed = int(ceil(height / ch))
|
|
||||||
cmd.c, cmd.r = ss.cols, num_of_rows_needed
|
|
||||||
else:
|
|
||||||
cmd.X = calculate_in_cell_x_offset(width, cw, align)
|
cmd.X = calculate_in_cell_x_offset(width, cw, align)
|
||||||
extra_cells = 0
|
extra_cells = 0
|
||||||
if align == 'center':
|
if align == 'center':
|
||||||
|
|||||||
Reference in New Issue
Block a user