aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvan Jegen <s.jegen@gmail.com>2014-06-06 22:09:22 +0200
committerChristoph Lohmann <20h@r-36.net>2014-06-15 12:12:23 +0200
commitc2fd2754ebea6f802e4c71219af269c58b78262e (patch)
tree0c28d6e72fc593aaaf383715e59aa575780de5f9
parent27b28f1dc264e9947ea22bd64fd8f00ac98442f5 (diff)
downloadst-c2fd2754ebea6f802e4c71219af269c58b78262e.tar.gz
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>
-rw-r--r--st.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/st.c b/st.c
index 3681776..2cf9a26 100644
--- a/st.c
+++ b/st.c
@@ -3245,28 +3245,22 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
3245 bytelen -= u8cblen; 3245 bytelen -= u8cblen;
3246 3246
3247 doesexist = XftCharExists(xw.dpy, font->match, unicodep); 3247 doesexist = XftCharExists(xw.dpy, font->match, unicodep);
3248 if(oneatatime || !doesexist || bytelen <= 0) { 3248 if(doesexist) {
3249 if(oneatatime || bytelen <= 0) { 3249 u8fl++;
3250 if(doesexist) { 3250 u8fblen += u8cblen;
3251 u8fl++; 3251 if(!oneatatime && bytelen > 0)
3252 u8fblen += u8cblen; 3252 continue;
3253 }
3254 }
3255
3256 if(u8fl > 0) {
3257 XftDrawStringUtf8(xw.draw, fg,
3258 font->match, xp,
3259 winy + font->ascent,
3260 (FcChar8 *)u8fs,
3261 u8fblen);
3262 xp += xw.cw * u8fl;
3263
3264 }
3265 break;
3266 } 3253 }
3267 3254
3268 u8fl++; 3255 if(u8fl > 0) {
3269 u8fblen += u8cblen; 3256 XftDrawStringUtf8(xw.draw, fg,
3257 font->match, xp,
3258 winy + font->ascent,
3259 (FcChar8 *)u8fs,
3260 u8fblen);
3261 xp += xw.cw * u8fl;
3262 }
3263 break;
3270 } 3264 }
3271 if(doesexist) { 3265 if(doesexist) {
3272 if(oneatatime) 3266 if(oneatatime)