mirror of
https://github.com/tmux/tmux.git
synced 2026-09-05 21:20:45 +00:00
Update image size accessor call sites
This commit is contained in:
@@ -259,7 +259,7 @@ image_glyph_make_shades(struct image *im, u_int levels)
|
||||
result = (levels == 5 ? data->shade5 : data->shade8);
|
||||
if (result != NULL)
|
||||
return (result);
|
||||
image_get_cell_size(im, &sx, &sy);
|
||||
image_get_size_in_cells(im, &sx, &sy);
|
||||
cells = (size_t)sx * sy;
|
||||
values = xcalloc(cells, sizeof *values);
|
||||
result = xcalloc(cells, 1);
|
||||
@@ -426,7 +426,7 @@ image_get_fallback_cell(struct tty *tty, struct image *im, u_int x, u_int y,
|
||||
if (detail == IMAGE_GLYPH_SHADE5 || detail == IMAGE_GLYPH_SHADE8) {
|
||||
levels = image_glyph_make_shades(im,
|
||||
detail == IMAGE_GLYPH_SHADE5 ? 5 : 8);
|
||||
image_get_cell_size(im, &sx, NULL);
|
||||
image_get_size_in_cells(im, &sx, NULL);
|
||||
level = levels[(size_t)y * sx + x];
|
||||
key = (detail == IMAGE_GLYPH_SHADE5 ? shades[level] :
|
||||
bold_shades[level]);
|
||||
|
||||
@@ -1070,7 +1070,7 @@ sixel_from_image(struct image *im, u_int ox, u_int oy, u_int cells_x,
|
||||
image_get_size(im, &source.width, &source.height);
|
||||
image_get_canvas_size(im, &source.canvas_width,
|
||||
&source.canvas_height);
|
||||
image_get_cell_size(im, &source.sx, &source.sy);
|
||||
image_get_size_in_cells(im, &source.sx, &source.sy);
|
||||
destination_width = (uint64_t)source.sx * xpixel;
|
||||
destination_height = (uint64_t)source.sy * ypixel;
|
||||
if (destination_width > UINT_MAX || destination_height > UINT_MAX)
|
||||
@@ -1311,7 +1311,7 @@ sixel_render_image(struct image *im, u_int xpixel, u_int ypixel)
|
||||
struct sixel_image *original;
|
||||
u_int sx, sy;
|
||||
|
||||
image_get_cell_size(im, &sx, &sy);
|
||||
image_get_size_in_cells(im, &sx, &sy);
|
||||
/* Preserve SIXEL's original palette and indexed pixels when possible. */
|
||||
original = image_get_sixel(im);
|
||||
if (original != NULL)
|
||||
|
||||
2
image.c
2
image.c
@@ -730,7 +730,7 @@ image_write(struct screen_write_ctx *ctx, struct image *im, u_int bg)
|
||||
u_int cx = s->cx, cy = s->cy;
|
||||
u_int x, y, sx, sy, lines;
|
||||
|
||||
image_get_cell_size(im, &sx, &sy);
|
||||
image_get_size_in_cells(im, &sx, &sy);
|
||||
if (sx > screen_size_x(s) - cx)
|
||||
sx = screen_size_x(s) - cx;
|
||||
if (sy > screen_size_y(s) - 1)
|
||||
|
||||
Reference in New Issue
Block a user