mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-02 09:01:39 -05:00
Only draw background if it's different from the border color
This commit is contained in:
parent
940f75173b
commit
4554c41bf8
1 changed files with 9 additions and 8 deletions
|
|
@ -271,7 +271,7 @@ apply_key_map(struct keyboard_map *mode, int sym, char *response)
|
||||||
struct terminal_color { double r, g, b, a; };
|
struct terminal_color { double r, g, b, a; };
|
||||||
struct color_scheme {
|
struct color_scheme {
|
||||||
struct terminal_color palette[16];
|
struct terminal_color palette[16];
|
||||||
struct terminal_color border;
|
int border_color;
|
||||||
char default_attr;
|
char default_attr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -643,7 +643,7 @@ struct color_scheme DEFAULT_COLORS = {
|
||||||
{ 0.33, 1, 1, 1 }, /* high cyan */
|
{ 0.33, 1, 1, 1 }, /* high cyan */
|
||||||
{ 1, 1, 1, 1 } /* white */
|
{ 1, 1, 1, 1 } /* white */
|
||||||
},
|
},
|
||||||
{ 0, 0, 0, 1 }, /* black border */
|
0, /* black border */
|
||||||
0x07 /* bg:black, fg:light gray */
|
0x07 /* bg:black, fg:light gray */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -657,7 +657,7 @@ terminal_draw_contents(struct terminal *terminal)
|
||||||
int row, col;
|
int row, col;
|
||||||
char attr;
|
char attr;
|
||||||
char toShow[5] = {0, };
|
char toShow[5] = {0, };
|
||||||
int foreground, background, bold, underline, tmp;
|
int border, foreground, background, bold, underline, tmp;
|
||||||
int text_x, text_y;
|
int text_x, text_y;
|
||||||
cairo_surface_t *surface;
|
cairo_surface_t *surface;
|
||||||
double d;
|
double d;
|
||||||
|
|
@ -669,11 +669,9 @@ terminal_draw_contents(struct terminal *terminal)
|
||||||
cr = cairo_create(surface);
|
cr = cairo_create(surface);
|
||||||
|
|
||||||
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
|
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
|
||||||
cairo_set_source_rgba(cr,
|
border = terminal->color_scheme->border_color;
|
||||||
terminal->color_scheme->border.r,
|
color = terminal->color_scheme->palette[border];
|
||||||
terminal->color_scheme->border.g,
|
cairo_set_source_rgba(cr, color.r, color.g, color.b, color.a);
|
||||||
terminal->color_scheme->border.b,
|
|
||||||
terminal->color_scheme->border.a);
|
|
||||||
cairo_paint(cr);
|
cairo_paint(cr);
|
||||||
|
|
||||||
cairo_set_font_face(cr, terminal->font_normal);
|
cairo_set_font_face(cr, terminal->font_normal);
|
||||||
|
|
@ -702,6 +700,9 @@ terminal_draw_contents(struct terminal *terminal)
|
||||||
background = tmp & ~ATTRMASK_INTENSITY;
|
background = tmp & ~ATTRMASK_INTENSITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (background == border)
|
||||||
|
continue;
|
||||||
|
|
||||||
color = terminal->color_scheme->palette[background];
|
color = terminal->color_scheme->palette[background];
|
||||||
cairo_set_source_rgba(cr, color.r, color.g, color.b, color.a);
|
cairo_set_source_rgba(cr, color.r, color.g, color.b, color.a);
|
||||||
cairo_move_to(cr, side_margin + (col * extents.max_x_advance),
|
cairo_move_to(cr, side_margin + (col * extents.max_x_advance),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue