ref: b1ebc6412e1b0e40fc4ee2f6c3c67428a3e1480f
parent: c40b9d21694a42dbf9cbcc25dd52ab4dd9751fcf
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Thu Feb 13 17:51:39 EST 2020
plan9: keep info at the bottom, limit the field drawing accordingly
--- a/plan9.c
+++ b/plan9.c
@@ -237,7 +237,7 @@
redraw(void)
{
Rectangle r;
- Point p, top;
+ Point p, top, bot;
int x, y, len;
draw(screen, screen->r, display->black, nil, ZP);
@@ -245,8 +245,10 @@
p.x += Txtoff;
p.y += Txtoff;
top = p;
+ bot.x = top.x;
+ bot.y = screen->r.max.y - Txtoff - charh*2;
- for (y = 0; y < field.height; y++) {
+ for (y = 0; y < field.height && p.y < bot.y-charh; y++) {
for (x = 0; x < field.width; x++) {
Rune c = field.buffer[field.width*y + x];
if (c == L'.')
@@ -258,7 +260,7 @@
p.y += font->height;
}
- p.y += 2 * font->height;
+ p = bot;
/* field size */
p.x = screen->r.min.x + Txtoff;