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

This commit is contained in:
Sigrid 2020-12-06 13:04:36 +01:00
parent a696951c6c
commit f5d9b2222b

View file

@ -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;
}