aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Stevens <nilix@nilfm.cc>2022-04-07 15:53:26 -0600
committerDerek Stevens <nilix@nilfm.cc>2022-04-07 15:53:26 -0600
commitfeb846ddb9239cb905792458bf2ad5dbb22ba427 (patch)
tree113cc7376287e763b0dab43ba6c99f5c4312435a
parentccb2aa148e25e4033cd89583ab7f7f3a04d701d3 (diff)
paint bg color when there isn't enough space in a window body for an entire line of text
-rw-r--r--wind.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/wind.c b/wind.c
index fc562fa..b25d9a1 100644
--- a/wind.c
+++ b/wind.c
@@ -219,6 +219,7 @@ int winresize(Window* w, Rectangle r, int safe, int keepextra) {
r1.min.y = y;
if (!safe || !eqrect(w->body.all, r1)) {
oy = y;
+
if (y + 1 + w->body.fr.font->height <= r.max.y) { /* room for one line */
r1.min.y = y;
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.max.y = r.max.y;
} else {
+ draw(screen, r1, textcols[BACK], nil, ZP);
r1.min.y = y;
r1.max.y = y;
}