mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
When shifting characters (for example with ALIGN_CENTER) set
colors of the empty area to the color of the first char of the centered text. Previously it was set to the default background.
This commit is contained in:
parent
42d2433f4b
commit
4ec188d75e
@ -238,7 +238,8 @@ realloc_spaces(struct part *part, int length)
|
|||||||
* This function does not update document.comb_x and document.comb_y.
|
* This function does not update document.comb_x and document.comb_y.
|
||||||
* That is the caller's responsibility. */
|
* That is the caller's responsibility. */
|
||||||
static inline void
|
static inline void
|
||||||
clear_hchars(struct html_context *html_context, int x, int y, int width)
|
clear_hchars(struct html_context *html_context, int x, int y, int width,
|
||||||
|
struct screen_char *a)
|
||||||
{
|
{
|
||||||
struct part *part;
|
struct part *part;
|
||||||
struct screen_char *pos, *end;
|
struct screen_char *pos, *end;
|
||||||
@ -261,9 +262,7 @@ clear_hchars(struct html_context *html_context, int x, int y, int width)
|
|||||||
end = pos + width - 1;
|
end = pos + width - 1;
|
||||||
end->data = ' ';
|
end->data = ' ';
|
||||||
end->attr = 0;
|
end->attr = 0;
|
||||||
set_screen_char_color(end, par_format.color.background, 0x0,
|
end->c = a->c;
|
||||||
COLOR_ENSURE_CONTRAST, /* for bug 461 */
|
|
||||||
part->document->options.color_mode);
|
|
||||||
|
|
||||||
while (pos < end)
|
while (pos < end)
|
||||||
copy_screen_chars(pos++, end, 1);
|
copy_screen_chars(pos++, end, 1);
|
||||||
@ -916,7 +915,7 @@ shift_chars(struct html_context *html_context, int y, int shift)
|
|||||||
assert_comb_x_y_ok(part->document);
|
assert_comb_x_y_ok(part->document);
|
||||||
if_assert_failed discard_comb_x_y(part->document);
|
if_assert_failed discard_comb_x_y(part->document);
|
||||||
|
|
||||||
clear_hchars(html_context, 0, y, shift);
|
clear_hchars(html_context, 0, y, shift, a);
|
||||||
copy_chars(html_context, shift, y, len, a);
|
copy_chars(html_context, shift, y, len, a);
|
||||||
fmem_free(a);
|
fmem_free(a);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user