diff options
Diffstat (limited to 'render.c')
| -rw-r--r-- | render.c | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -614,12 +614,21 @@ cursor_colors_for_cell(const struct terminal *term, const struct cell *cell, *text_color = *bg; } - if (text_color->red == cursor_color->red && - text_color->green == cursor_color->green && - text_color->blue == cursor_color->blue) + if (unlikely(text_color->red == cursor_color->red && + text_color->green == cursor_color->green && + text_color->blue == cursor_color->blue)) { - *text_color = color_hex_to_pixman(term->colors.bg, gamma_correct); - *cursor_color = color_hex_to_pixman(term->colors.fg, gamma_correct); + *text_color = *bg; + *cursor_color = *fg; + + if (text_color->red == cursor_color->red && + text_color->green == cursor_color->green && + text_color->blue == cursor_color->blue) + { + cursor_color->red = ~cursor_color->red; + cursor_color->green = ~cursor_color->green; + cursor_color->blue = ~cursor_color->blue; + } } } |
