Revert "Fix crash when cursor color is truecolor"
This reverts commit 5535c1f04c
.
This commit is contained in:
parent
5535c1f04c
commit
732be223ee
1 changed files with 5 additions and 14 deletions
19
x.c
19
x.c
|
@ -1404,7 +1404,6 @@ void
|
||||||
xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
|
xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
|
||||||
{
|
{
|
||||||
Color drawcol;
|
Color drawcol;
|
||||||
uint32_t cc;
|
|
||||||
|
|
||||||
/* remove the old cursor */
|
/* remove the old cursor */
|
||||||
if (selected(ox, oy))
|
if (selected(ox, oy))
|
||||||
|
@ -1420,22 +1419,14 @@ 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;
|
g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE;
|
||||||
|
|
||||||
if (selected(cx, cy)) {
|
if (selected(cx, cy)) {
|
||||||
cc = g.bg;
|
drawcol = dc.col[g.bg];
|
||||||
} else {
|
} else {
|
||||||
g.mode |= ATTR_REVERSE;
|
g.mode |= ATTR_REVERSE;
|
||||||
if (g.mode & ATTR_BOLD && BETWEEN(g.fg, 0, 7))
|
|
||||||
cc = g.fg + 8;
|
|
||||||
else
|
|
||||||
cc = g.fg;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IS_TRUECOL(cc)) {
|
if (g.mode & ATTR_BOLD && BETWEEN(g.fg, 0, 7))
|
||||||
drawcol.color.alpha = 0xffff;
|
drawcol = dc.col[g.fg + 8];
|
||||||
drawcol.color.red = TRUERED(cc);
|
else
|
||||||
drawcol.color.green = TRUEGREEN(cc);
|
drawcol = dc.col[g.fg];
|
||||||
drawcol.color.blue = TRUEBLUE(cc);
|
|
||||||
} else {
|
|
||||||
drawcol = dc.col[cc];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_SET(MODE_REVERSE)) {
|
if (IS_SET(MODE_REVERSE)) {
|
||||||
|
|
Loading…
Reference in a new issue