From a696951c6cbad354373a820ed1d14e25697d1fa3 Mon Sep 17 00:00:00 2001 From: Sigrid Date: Sun, 6 Dec 2020 13:02:33 +0100 Subject: rio: goodrect: clarify minimal height and actually use the smallest reasonable value --- sys/src/cmd/rio/wctl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/src/cmd/rio/wctl.c b/sys/src/cmd/rio/wctl.c index b4caa4ba4..22f7b501c 100644 --- a/sys/src/cmd/rio/wctl.c +++ b/sys/src/cmd/rio/wctl.c @@ -95,7 +95,12 @@ goodrect(Rectangle r) return 0; if(Dy(r) > BIG*Dy(screen->r)) return 0; - if(Dx(r) < 100 || Dy(r) < 3*Borderwidth+font->height) + /* + * the height has to be big enough to fit one line of text. + * that includes the border on each side with an extra pixel + * so that the text is still drawn + */ + if(Dx(r) < 100 || Dy(r) < 2*(Borderwidth+1)+font->height) return 0; /* window must be on screen */ if(!rectXrect(screen->r, r)) -- cgit v1.2.3