renderer: render underline color if set

This commit is contained in:
Mitchell Hashimoto
2023-06-20 09:39:52 -07:00
parent 860209e968
commit 1c2451b532
2 changed files with 9 additions and 4 deletions

View File

@ -1023,11 +1023,13 @@ pub fn updateCell(
null, null,
); );
const color = if (cell.attrs.underline_color) cell.underline_fg else colors.fg;
self.cells.appendAssumeCapacity(.{ self.cells.appendAssumeCapacity(.{
.mode = .fg, .mode = .fg,
.grid_pos = .{ @intToFloat(f32, x), @intToFloat(f32, y) }, .grid_pos = .{ @intToFloat(f32, x), @intToFloat(f32, y) },
.cell_width = cell.widthLegacy(), .cell_width = cell.widthLegacy(),
.color = .{ colors.fg.r, colors.fg.g, colors.fg.b, alpha }, .color = .{ color.r, color.g, color.b, alpha },
.glyph_pos = .{ glyph.atlas_x, glyph.atlas_y }, .glyph_pos = .{ glyph.atlas_x, glyph.atlas_y },
.glyph_size = .{ glyph.width, glyph.height }, .glyph_size = .{ glyph.width, glyph.height },
.glyph_offset = .{ glyph.offset_x, glyph.offset_y }, .glyph_offset = .{ glyph.offset_x, glyph.offset_y },

View File

@ -1181,6 +1181,9 @@ pub fn updateCell(
@enumToInt(sprite), @enumToInt(sprite),
null, null,
); );
const color = if (cell.attrs.underline_color) cell.underline_fg else colors.fg;
self.cells.appendAssumeCapacity(.{ self.cells.appendAssumeCapacity(.{
.mode = .fg, .mode = .fg,
.grid_col = @intCast(u16, x), .grid_col = @intCast(u16, x),
@ -1192,9 +1195,9 @@ pub fn updateCell(
.glyph_height = underline_glyph.height, .glyph_height = underline_glyph.height,
.glyph_offset_x = underline_glyph.offset_x, .glyph_offset_x = underline_glyph.offset_x,
.glyph_offset_y = underline_glyph.offset_y, .glyph_offset_y = underline_glyph.offset_y,
.fg_r = colors.fg.r, .fg_r = color.r,
.fg_g = colors.fg.g, .fg_g = color.g,
.fg_b = colors.fg.b, .fg_b = color.b,
.fg_a = alpha, .fg_a = alpha,
.bg_r = 0, .bg_r = 0,
.bg_g = 0, .bg_g = 0,