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

This commit is contained in:
Sigrid 2020-12-06 13:02:33 +01:00
parent 7f7c151687
commit a696951c6c

View file

@ -95,7 +95,12 @@ goodrect(Rectangle r)
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))