diff options
author | Silvan Jegen <s.jegen@gmail.com> | 2014-06-06 22:09:22 +0200 |
---|---|---|
committer | Christoph Lohmann <20h@r-36.net> | 2014-06-15 12:12:23 +0200 |
commit | c2fd2754ebea6f802e4c71219af269c58b78262e (patch) | |
tree | 0c28d6e72fc593aaaf383715e59aa575780de5f9 /st.c | |
parent | 27b28f1dc264e9947ea22bd64fd8f00ac98442f5 (diff) | |
download | st-c2fd2754ebea6f802e4c71219af269c58b78262e.tar.gz st-c2fd2754ebea6f802e4c71219af269c58b78262e.tar.bz2 st-c2fd2754ebea6f802e4c71219af269c58b78262e.zip |
Refactor the innermost loop of the xdraws function
Signed-off-by: Silvan Jegen <s.jegen@gmail.com>
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 34 |
1 files changed, 14 insertions, 20 deletions
@@ -3245,28 +3245,22 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) { bytelen -= u8cblen; doesexist = XftCharExists(xw.dpy, font->match, unicodep); - if(oneatatime || !doesexist || bytelen <= 0) { - if(oneatatime || bytelen <= 0) { - if(doesexist) { - u8fl++; - u8fblen += u8cblen; - } - } - - if(u8fl > 0) { - XftDrawStringUtf8(xw.draw, fg, - font->match, xp, - winy + font->ascent, - (FcChar8 *)u8fs, - u8fblen); - xp += xw.cw * u8fl; - - } - break; + if(doesexist) { + u8fl++; + u8fblen += u8cblen; + if(!oneatatime && bytelen > 0) + continue; } - u8fl++; - u8fblen += u8cblen; + if(u8fl > 0) { + XftDrawStringUtf8(xw.draw, fg, + font->match, xp, + winy + font->ascent, + (FcChar8 *)u8fs, + u8fblen); + xp += xw.cw * u8fl; + } + break; } if(doesexist) { if(oneatatime) |