From 9ff064ff7ff3150e4b1e6494f95bb1fd102fec60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 31 Jan 2016 13:42:54 +0100 Subject: [PATCH] On scroll widgets only display tooltip in main area This makes sure tooltip is only displayed in the "view" area of scroll widget. Other areas are scrollbars and since they cannot have custom tooltips, it should not affect any functionality. Fixes #2848. --- src/input.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/input.c b/src/input.c index 7e9c14bff5..a715fb6abe 100644 --- a/src/input.c +++ b/src/input.c @@ -896,12 +896,12 @@ static void input_widget_over(int x, int y, rct_window *w, int widgetIndex) input_widget_over_change_check(windowClass, windowNumber, widgetIndex); if (w != NULL && widgetIndex != -1 && widget->type == WWT_SCROLL) { - int eax, ebx, ecx, edx; - widget_scroll_get_part(w, widget, x, y, &eax, &ebx, &ecx, &edx); + int eax, ebx, scroll_part, edx; + widget_scroll_get_part(w, widget, x, y, &eax, &ebx, &scroll_part, &edx); - if (ecx < 0) - input_update_tooltip(w, widgetIndex, x, y); - else if (ecx == 0) { + if (scroll_part != SCROLL_PART_VIEW) + window_tooltip_close(); + else { window_event_scroll_mouseover_call(w, edx, eax, ebx); input_update_tooltip(w, widgetIndex, x, y); }