summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSigrid <ftrvxmtrx@gmail.com>2020-12-06 13:02:33 +0100
committerSigrid <ftrvxmtrx@gmail.com>2020-12-06 13:02:33 +0100
commita696951c6cbad354373a820ed1d14e25697d1fa3 (patch)
tree7eccd0ef54320becf2857b1b33ad08bf12ae51d6
parent7f7c1516876a0afacca2822e3e083c79551ad92c (diff)
downloadplan9front-a696951c6cbad354373a820ed1d14e25697d1fa3.tar.xz
rio: goodrect: clarify minimal height and actually use the smallest reasonable value
-rw-r--r--sys/src/cmd/rio/wctl.c7
1 files changed, 6 insertions, 1 deletions
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))