mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-12 02:19:41 +00:00
Fix #7227: Don't apply mouse-hasn't-moved test to scrollbars.
This commit is contained in:
parent
69928df3f0
commit
56a6d7aec8
@ -2436,14 +2436,14 @@ static EventState HandleActiveWidget()
|
|||||||
return ES_HANDLED;
|
return ES_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If cursor hasn't moved, there is nothing to do. */
|
|
||||||
if (_cursor.delta.x == 0 && _cursor.delta.y == 0) return ES_HANDLED;
|
|
||||||
|
|
||||||
/* Handle scrollbar internally, or dispatch click event */
|
/* Handle scrollbar internally, or dispatch click event */
|
||||||
WidgetType type = w->GetWidget<NWidgetBase>(w->mouse_capture_widget)->type;
|
WidgetType type = w->GetWidget<NWidgetBase>(w->mouse_capture_widget)->type;
|
||||||
if (type == NWID_VSCROLLBAR || type == NWID_HSCROLLBAR) {
|
if (type == NWID_VSCROLLBAR || type == NWID_HSCROLLBAR) {
|
||||||
HandleScrollbarScrolling(w);
|
HandleScrollbarScrolling(w);
|
||||||
} else {
|
} else {
|
||||||
|
/* If cursor hasn't moved, there is nothing to do. */
|
||||||
|
if (_cursor.delta.x == 0 && _cursor.delta.y == 0) return ES_HANDLED;
|
||||||
|
|
||||||
Point pt = { _cursor.pos.x - w->left, _cursor.pos.y - w->top };
|
Point pt = { _cursor.pos.x - w->left, _cursor.pos.y - w->top };
|
||||||
w->OnClick(pt, w->mouse_capture_widget, 0);
|
w->OnClick(pt, w->mouse_capture_widget, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user