shithub: riscv

Download patch

ref: a696951c6cbad354373a820ed1d14e25697d1fa3
parent: 7f7c1516876a0afacca2822e3e083c79551ad92c
author: Sigrid <[email protected]>
date: Sun Dec 6 08:02:33 EST 2020

rio: goodrect: clarify minimal height and actually use the smallest reasonable value

--- a/sys/src/cmd/rio/wctl.c
+++ b/sys/src/cmd/rio/wctl.c
@@ -95,7 +95,12 @@
 		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))