commit e829e13bb1a830e0cdce749ea0865cd93af1846c
Author: Benno Fünfstück <benno.fuenfstueck_AT_gmail.com>
AuthorDate: Tue Dec 26 16:38:27 2017 +0100
Commit: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
CommitDate: Tue Dec 26 22:54:06 2017 +0100
Apply ATTR_REVERSE after ATTR_FAINT
An example where the new behaviour makes more sense:
Suppose some text is formatted with ATTR_FAINT for red for the foreground, so it
is rendered in a dark red. In that case, when selected with the mouse, the
intended behaviour is that foreground and background color are swapped: so the
selection should be rendered in dark red and the text in the default background
color.
Before this patch, what happened was that the selection would be in normal red
and the text in the darkened background color, making it almost unreadable.
For an example application that uses the FAINT attribute, try dmesg from
util-linux with color support, it uses FAINT for segfault messages.
diff --git a/x.c b/x.c
index 191e5dc..474d73b 100644
--- a/x.c
+++ b/x.c
_AT_@ -1189,12 +1189,6 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
}
}
- if (base.mode & ATTR_REVERSE) {
- temp = fg;
- fg = bg;
- bg = temp;
- }
-
if ((base.mode & ATTR_BOLD_FAINT) == ATTR_FAINT) {
colfg.red = fg->color.red / 2;
colfg.green = fg->color.green / 2;
_AT_@ -1203,6 +1197,13 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
fg = &revfg;
}
+
+ if (base.mode & ATTR_REVERSE) {
+ temp = fg;
+ fg = bg;
+ bg = temp;
+ }
+
if (base.mode & ATTR_BLINK && term.mode & MODE_BLINK)
fg = bg;
Received on Tue Dec 26 2017 - 22:55:58 CET
This archive was generated by hypermail 2.3.0
: Tue Dec 26 2017 - 23:00:28 CET