diff options
author | Jules Maselbas <jules.maselbas@grenoble-inp.org> | 2018-07-14 11:16:36 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2018-07-14 12:49:35 +0200 |
commit | 1911c9274d9b03f3d7999c6ce26e2d5169642d26 (patch) | |
tree | a5d459ad19403dd4e4ca086ec6d98917880a0e62 /x.c | |
parent | 29f341da7cf32888f45005e08de202d9a372d972 (diff) |
Simplify cursor color handling
Diffstat (limited to 'x.c')
-rw-r--r-- | x.c | 30 |
1 files changed, 12 insertions, 18 deletions
@@ -1418,25 +1418,19 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) */ g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE; - if (IS_SET(MODE_REVERSE)) { - g.mode |= ATTR_REVERSE; - g.bg = defaultfg; - if (selected(cx, cy)) { - drawcol = dc.col[defaultcs]; - g.fg = defaultrcs; - } else { - drawcol = dc.col[defaultrcs]; - g.fg = defaultcs; - } + if (selected(cx, cy)) { + g.bg = defaultrcs; + g.fg = defaultfg; } else { - if (selected(cx, cy)) { - g.fg = defaultfg; - g.bg = defaultrcs; - } else { - g.fg = defaultbg; - g.bg = defaultcs; - } - drawcol = dc.col[g.bg]; + g.bg = defaultcs; + g.fg = defaultbg; + } + drawcol = dc.col[g.bg]; + + if (IS_SET(MODE_REVERSE)) { + drawcol.color.red = ~drawcol.color.red; + drawcol.color.green = ~drawcol.color.green; + drawcol.color.blue = ~drawcol.color.blue; } /* draw the new one */ |