mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-21 19:32:54 +01:00
Fix: Zoom-scroll extra viewports only if the mouse cursor is over the viewport. (#14209)
This commit is contained in:
@@ -2823,7 +2823,11 @@ static void MouseLoop(MouseClick click, int mousewheel)
|
||||
|
||||
if (mousewheel != 0) {
|
||||
/* Send mousewheel event to window, unless we're scrolling a viewport or the map */
|
||||
if (!scrollwheel_scrolling || (vp == nullptr && w->window_class != WC_SMALLMAP)) w->OnMouseWheel(mousewheel);
|
||||
if (!scrollwheel_scrolling || (vp == nullptr && w->window_class != WC_SMALLMAP)) {
|
||||
if (NWidgetCore *nwid = w->nested_root->GetWidgetFromPos(x - w->left, y - w->top); nwid != nullptr) {
|
||||
w->OnMouseWheel(mousewheel, nwid->GetIndex());
|
||||
}
|
||||
}
|
||||
|
||||
/* Dispatch a MouseWheelEvent for widgets if it is not a viewport */
|
||||
if (vp == nullptr) DispatchMouseWheelEvent(w, w->nested_root->GetWidgetFromPos(x - w->left, y - w->top), mousewheel);
|
||||
|
||||
Reference in New Issue
Block a user