Fixing a off-by-one error in the penultimate row drawing.

This commit is contained in:
Christoph Lohmann 2012-12-22 13:39:27 +01:00
parent 4d37763ee7
commit ac4c6da4ef
1 changed files with 9 additions and 6 deletions

13
st.c
View File

@ -2515,8 +2515,11 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
} }
} }
if(base.mode & ATTR_REVERSE) if(base.mode & ATTR_REVERSE) {
temp = fg, fg = bg, bg = temp; temp = fg;
fg = bg;
bg = temp;
}
XftTextExtentsUtf8(xw.dpy, font->set, (FcChar8 *)s, bytelen, XftTextExtentsUtf8(xw.dpy, font->set, (FcChar8 *)s, bytelen,
&extents); &extents);
@ -2525,11 +2528,11 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
/* Intelligent cleaning up of the borders. */ /* Intelligent cleaning up of the borders. */
if(x == 0) { if(x == 0) {
xclear(0, (y == 0)? 0 : winy, borderpx, xclear(0, (y == 0)? 0 : winy, borderpx,
winy + xw.ch + ((y == term.row-1)? xw.h : 0)); winy + xw.ch + ((y >= term.row-1)? xw.h : 0));
} }
if(x + charlen >= term.col-1) { if(x + charlen >= term.col)
xclear(winx + width, (y == 0)? 0 : winy, xw.w, xclear(winx + width, (y == 0)? 0 : winy, xw.w,
((y == term.row-1)? xw.h : (winy + xw.ch))); ((y >= term.row-1)? xw.h : (winy + xw.ch)));
} }
if(y == 0) if(y == 0)
xclear(winx, 0, winx + width, borderpx); xclear(winx, 0, winx + width, borderpx);