treat menu width the same as the height is treated when deciding its

max size and location; partially from a diff from Alexander Polakov.
This commit is contained in:
okan 2012-10-23 15:50:15 +00:00
parent c21d56e5a1
commit 637c52abf8

8
menu.c
View File

@ -358,10 +358,12 @@ menu_draw(struct screen_ctx *sc, struct menu_ctx *mc, struct menu_q *menuq,
xsave = mc->x; xsave = mc->x;
ysave = mc->y; ysave = mc->y;
if (mc->x < xmin) if (mc->x + mc->width >= xmax)
mc->x = xmin;
else if (mc->x + mc->width >= xmax)
mc->x = xmax - mc->width; mc->x = xmax - mc->width;
if (mc->x < xmin) {
mc->x = xmin;
mc->width = xmax - xmin;
}
if (mc->y + dy >= ymax) if (mc->y + dy >= ymax)
mc->y = ymax - dy; mc->y = ymax - dy;