1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-26 02:46:13 -04:00

[document] Added cell_width and cell_height to document options

This commit is contained in:
Witold Filipczyk 2023-05-26 19:22:56 +02:00
parent 721d7795cf
commit c8f55f5df0
3 changed files with 12 additions and 2 deletions

View File

@ -114,6 +114,13 @@ init_document_options(struct session *ses, struct document_options *doo)
doo->image_link.display_style = get_opt_int("document.browse.images.display_style", ses);
doo->image_link.tagging = get_opt_int("document.browse.images.image_link_tagging", ses);
doo->image_link.show_any_as_links = get_opt_bool("document.browse.images.show_any_as_links", ses);
#ifdef CONFIG_LIBSIXEL
if (ses && ses->tab->term) {
doo->cell_width = ses->tab->term->cell_width;
doo->cell_height = ses->tab->term->cell_height;
}
#endif
}
int

View File

@ -62,7 +62,10 @@ struct document_options {
int meta_link_display;
int default_form_input_size;
int document_width;
#ifdef CONFIG_LIBSIXEL
int cell_width;
int cell_height;
#endif
/** @name The default (fallback) colors.
* @{ */
struct text_style default_style;

View File

@ -849,7 +849,7 @@ add_image_to_document(struct document *doc, struct string *pixels, int lineno)
im->height = height;
add_string_to_string(&im->pixels, pixels);
ile = (height + 12) / 13;
ile = (height + doc->options.cell_height - 1) / doc->options.cell_height;
add_to_list(doc->images, im);
end:
sixel_frame_unref(frame);