git: 9front

Download patch

ref: 3f2d4c3b48fd2d4df26180b078fabfc8e7c63033
parent: 111ffc09377d921e2fb8798db038a5b896527fc6
author: Sigrid <ftrvxmtrx@gmail.com>
date: Sun Dec 6 08:04:36 EST 2020

rio: handle corner selection for resizing better (thanks cinap)

--- a/sys/src/cmd/rio/rio.c
+++ b/sys/src/cmd/rio/rio.c
@@ -392,13 +392,15 @@
 int
 portion(int x, int lo, int hi)
 {
+	int t;
 	x -= lo;
 	hi -= lo;
-	if(hi < 20)
+	t = min(20, max(1, hi/2));
+	if(hi < t)
 		return x > 0 ? 2 : 0;
-	if(x < 20)
+	if(x < t)
 		return 0;
-	if(x > hi-20)
+	if(x > hi-t)
 		return 2;
 	return 1;
 }
--