diff options
author | Sigrid <ftrvxmtrx@gmail.com> | 2020-12-06 13:04:36 +0100 |
---|---|---|
committer | Sigrid <ftrvxmtrx@gmail.com> | 2020-12-06 13:04:36 +0100 |
commit | f5d9b2222bc6194f35442894e0ca0ea9bb8e1f23 (patch) | |
tree | abee9c35b219d7e4f356f49d8fb77c287ddf6d6b | |
parent | a696951c6cbad354373a820ed1d14e25697d1fa3 (diff) | |
download | plan9front-f5d9b2222bc6194f35442894e0ca0ea9bb8e1f23.tar.xz |
rio: handle corner selection for resizing better (thanks cinap)
-rw-r--r-- | sys/src/cmd/rio/rio.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/src/cmd/rio/rio.c b/sys/src/cmd/rio/rio.c index a42721fac..458d26d34 100644 --- a/sys/src/cmd/rio/rio.c +++ b/sys/src/cmd/rio/rio.c @@ -392,13 +392,15 @@ whichrect(Rectangle r, Point p, int which) 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; } |