fix: don't alpha blend selections over matches

This commit is contained in:
CJ van den Berg 2024-11-04 23:34:47 +01:00
parent 1545eb988d
commit cbcf8cc2dd
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 5 additions and 0 deletions

View file

@ -55,6 +55,10 @@ pub inline fn set_style_fg(self: *Cell, style_: Style) void {
if (style_.fg) |fg| self.cell.style.fg = apply_alpha(self.cell.style.bg, fg);
}
pub inline fn set_style_bg_opaque(self: *Cell, style_: Style) void {
if (style_.bg) |bg| self.cell.style.bg = vaxis.Cell.Color.rgbFromUint(bg.color);
}
pub inline fn set_style_bg(self: *Cell, style_: Style) void {
if (style_.bg) |bg| self.cell.style.bg = apply_alpha(self.cell.style.bg, bg);
}

View file

@ -972,6 +972,7 @@ pub const Editor = struct {
}
inline fn render_selection_cell(_: *const Self, theme: *const Widget.Theme, cell: *Cell) void {
cell.set_style_bg_opaque(theme.editor);
cell.set_style_bg(theme.editor_selection);
}