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 d23d607f19
commit bb65c9fc09

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(); entry = y / font_height();
/* in bounds? */ /* 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 < 0 || entry >= mc->num)
entry = -1; entry = -1;