X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fgadgets.c;h=75d0a8558970bcb8b2da5ba4f74ec5c4a25e85c2;hb=d9e1c98384aa3db472f17e8f335192ef6ef7f7b8;hp=6200c9dc3da22291d19e086f1c5acdf99685e4d4;hpb=b4e74fe434deee25bf99f6d44376d6ae06b7c832;p=rocksndiamonds.git diff --git a/src/libgame/gadgets.c b/src/libgame/gadgets.c index 6200c9dc..75d0a855 100644 --- a/src/libgame/gadgets.c +++ b/src/libgame/gadgets.c @@ -96,6 +96,16 @@ static struct GadgetInfo *getGadgetInfoFromMousePosition(int mx, int my, boolean check_horizontal = (IS_WHEEL_BUTTON_HORIZONTAL(button) || GetKeyModState() & KMOD_Shift); + /* check for the first active scrollbar directly under the mouse pointer */ + for (gi = gadget_list_first_entry; gi != NULL; gi = gi->next) + { + if (gi->mapped && gi->active && + (gi->type & GD_TYPE_SCROLLBAR) && + mx >= gi->x && mx < gi->x + gi->width && + my >= gi->y && my < gi->y + gi->height) + return gi; + } + /* check for the first active scrollbar with matching mouse wheel area */ for (gi = gadget_list_first_entry; gi != NULL; gi = gi->next) { @@ -1779,7 +1789,7 @@ boolean HandleGadgets(int mx, int my, int button) { boolean scroll_single_step = ((GetKeyModState() & KMOD_Alt) != 0); - item_steps = (scroll_single_step ? 1 : DEFAULT_WHEEL_STEPS); + item_steps = (scroll_single_step ? 1 : wheel_steps); item_direction = (button == MB_WHEEL_UP || button == MB_WHEEL_LEFT ? -1 : +1); }