X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Flibgame%2Fgadgets.c;h=75d0a8558970bcb8b2da5ba4f74ec5c4a25e85c2;hp=1a0da4b45f55ad6dd469efb796edd063049052b4;hb=791c71ebdff49bada6e1becaca5482af8804d645;hpb=ad9e949d57e4055331f1eb0a14a9b8b6ebe6a7c3 diff --git a/src/libgame/gadgets.c b/src/libgame/gadgets.c index 1a0da4b4..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) {