X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fgadgets.c;h=b01fe169245ebb414aa3122a1867bf410854076f;hb=33cf8c53fa267584efab93b15a99fbf78f9fb0c1;hp=e939f865a5ace5063ea78374a2b0b69c657c5758;hpb=d109a83b1b41088e536efa0788d5cb33382bbe18;p=rocksndiamonds.git diff --git a/src/libgame/gadgets.c b/src/libgame/gadgets.c index e939f865..b01fe169 100644 --- a/src/libgame/gadgets.c +++ b/src/libgame/gadgets.c @@ -73,11 +73,14 @@ static struct GadgetInfo *getGadgetInfoFromMousePosition(int mx, int my, /* first check for scrollbars in case of mouse scroll wheel button events */ if (button == 4 || button == 5) { + boolean check_horizontal = (GetKeyModState() & KMOD_Control); + /* check for the first active scrollbar with matching mouse wheel area */ for (gi = gadget_list_first_entry; gi != NULL; gi = gi->next) { if (gi->mapped && gi->active && - gi->type & GD_TYPE_SCROLLBAR && + ((gi->type & GD_TYPE_SCROLLBAR_HORIZONTAL && check_horizontal) || + (gi->type & GD_TYPE_SCROLLBAR_VERTICAL && !check_horizontal)) && mx >= gi->wheelarea.x && mx < gi->wheelarea.x + gi->wheelarea.width && my >= gi->wheelarea.y && my < gi->wheelarea.y + gi->wheelarea.height) return gi;