rio: fix goodrect() bug (thanks mike)

mike from eff0ff.net reported the following:

> I was running a second instance of rio inside a rio window and
> suddenly weird things started happening. The second instance started
> imposing arbitrary limits on the size of its windows and refused to
> resize some of its windows when its own window was resized.
> Turns out this happens if rio's screen is 3 times as high as wide
> because of a tiny mistake in its goodrect function.

... and kindly provided a patch. thanks!
This commit is contained in:
cinap_lenrek 2020-03-07 20:41:46 +01:00
parent feb6d6f0a3
commit 1a1b4b54b3

View file

@ -93,7 +93,7 @@ goodrect(Rectangle r)
/* reasonable sizes only please */
if(Dx(r) > BIG*Dx(screen->r))
return 0;
if(Dy(r) > BIG*Dx(screen->r))
if(Dy(r) > BIG*Dy(screen->r))
return 0;
if(Dx(r) < 100 || Dy(r) < 3*font->height)
return 0;