cleaner version of previous fix
This commit is contained in:
12
st.c
12
st.c
@@ -3030,13 +3030,13 @@ drawregion(int x1, int y1, int x2, int y2)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* draw from horizontally scrolled position */
|
/* draw from horizontally scrolled position */
|
||||||
/* ensure we draw at least the visible width, limited by actual line content */
|
/* fix inconsistent line lengths: ensure we draw full terminal width when possible */
|
||||||
int visible_width = MIN(x2, linelen - term.hscr);
|
int draw_width = MIN(x2, linelen - term.hscr);
|
||||||
if (visible_width < x2 && linelen > term.hscr) {
|
if (draw_width < x2 && linelen > term.hscr) {
|
||||||
/* if line extends beyond what we calculated, draw more */
|
/* expand to terminal width if line might have more content */
|
||||||
visible_width = MIN(x2, MAX(visible_width, term.col));
|
draw_width = x2;
|
||||||
}
|
}
|
||||||
xdrawline(&line[term.hscr], x1, y, visible_width);
|
xdrawline(&line[term.hscr], x1, y, draw_width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user