fix off-by-one where a mere click would select the first item inside a menu

from Thomas Pfaff

ok oga@
This commit is contained in:
okan 2009-12-07 19:48:08 +00:00
parent ab4d36531c
commit 46630531f8

2
menu.c
View File

@ -398,7 +398,7 @@ menu_calc_entry(struct screen_ctx *sc, struct menu_ctx *mc, int x, int y)
entry = y / font_height();
/* in bounds? */
if (x < 0 || x > mc->width || y < 0 || y > font_height() * mc->num ||
if (x <= 0 || x > mc->width || y <= 0 || y > font_height() * mc->num ||
entry < 0 || entry >= mc->num)
entry = -1;