aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Eurenius <aes@spotify.com>2014-06-21 20:32:34 +0200
committerRoberto E. Vargas Caballero <k0ga@shike2.com>2014-06-27 14:07:22 +0200
commit1fc4afd1e6609732178369c7f17c917204aad4cc (patch)
tree7686cbd590927024c3f6229aa2c1358c1024cdb8
parent21bd4f4f9dce4dd19f218965e5a223c93a5a0fec (diff)
downloadst-1fc4afd1e6609732178369c7f17c917204aad4cc.tar.gz
Render struck-out attribute
Implement crossed-out text with an XftDrawRect call, similar to how underline is implemented. The line is drawn at 2/3 of the font ascent, which seems to work nicely in practice. Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
-rw-r--r--st.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/st.c b/st.c
index a69cc9e..3aa8539 100644
--- a/st.c
+++ b/st.c
@@ -3383,6 +3383,11 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
width, 1);
}
+ if(base.mode & ATTR_STRUCK) {
+ XftDrawRect(xw.draw, fg, winx, winy + 2 * font->ascent / 3,
+ width, 1);
+ }
+
/* Reset clip to none. */
XftDrawSetClip(xw.draw, 0);
}
remember that computers suck.