paint bg color when there isn't enough space in a window body for an entire line of text

This commit is contained in:
Iris Lightshard 2022-04-07 15:53:26 -06:00
parent ccb2aa148e
commit feb846ddb9
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398

2
wind.c
View file

@ -219,6 +219,7 @@ int winresize(Window* w, Rectangle r, int safe, int keepextra) {
r1.min.y = y; r1.min.y = y;
if (!safe || !eqrect(w->body.all, r1)) { if (!safe || !eqrect(w->body.all, r1)) {
oy = y; oy = y;
if (y + 1 + w->body.fr.font->height <= r.max.y) { /* room for one line */ if (y + 1 + w->body.fr.font->height <= r.max.y) { /* room for one line */
r1.min.y = y; r1.min.y = y;
r1.max.y = y + 1; r1.max.y = y + 1;
@ -227,6 +228,7 @@ int winresize(Window* w, Rectangle r, int safe, int keepextra) {
r1.min.y = min(y, r.max.y); r1.min.y = min(y, r.max.y);
r1.max.y = r.max.y; r1.max.y = r.max.y;
} else { } else {
draw(screen, r1, textcols[BACK], nil, ZP);
r1.min.y = y; r1.min.y = y;
r1.max.y = y; r1.max.y = y;
} }