projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ad9e949
)
added scrolling any scrollbars under the mouse pointer with mouse wheel
author
Holger Schemel
<info@artsoft.org>
Fri, 17 Jun 2016 18:34:34 +0000
(20:34 +0200)
committer
Holger Schemel
<info@artsoft.org>
Fri, 17 Jun 2016 18:34:34 +0000
(20:34 +0200)
src/libgame/gadgets.c
patch
|
blob
|
history
diff --git
a/src/libgame/gadgets.c
b/src/libgame/gadgets.c
index 1a0da4b45f55ad6dd469efb796edd063049052b4..75d0a8558970bcb8b2da5ba4f74ec5c4a25e85c2 100644
(file)
--- 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);
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)
{
/* check for the first active scrollbar with matching mouse wheel area */
for (gi = gadget_list_first_entry; gi != NULL; gi = gi->next)
{