summaryrefslogtreecommitdiff
path: root/src/widget.cpp
diff options
context:
space:
mode:
authorPeter Nelson <peter1138@openttd.org>2021-04-21 15:22:45 +0100
committerMichael Lutz <michi@icosahedron.de>2021-04-21 23:12:10 +0200
commit2a0365b3d992fb602fd91b218b4a8647ddb46975 (patch)
tree54ec865630b8292ce84eb47fff78f407411926ab /src/widget.cpp
parent96b78bc2cd9790e89228c53b4803a78320fc20bd (diff)
downloadopenttd-2a0365b3d992fb602fd91b218b4a8647ddb46975.tar.xz
Cleanup: Remove unnecessary parameter of GetScrolledRowFromWidget()
Line height defaults to the resize height of the relevant widget, which is set in all cases. Therefore it is not necessary to specify this value every time. Additionally fixes scrolled padding for the framerate window.
Diffstat (limited to 'src/widget.cpp')
-rw-r--r--src/widget.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/widget.cpp b/src/widget.cpp
index 4be4cf331..123e8a2f9 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -1964,12 +1964,11 @@ void NWidgetViewport::UpdateViewportCoordinates(Window *w)
* @param w The window the click was in.
* @param widget Widget number of the widget clicked in.
* @param padding Amount of empty space between the widget edge and the top of the first row. Default value is \c 0.
- * @param line_height Height of a single row. A negative value means using the vertical resize step of the widget.
* @return Row number clicked at. If clicked at a wrong position, #INT_MAX is returned.
*/
-int Scrollbar::GetScrolledRowFromWidget(int clickpos, const Window * const w, int widget, int padding, int line_height) const
+int Scrollbar::GetScrolledRowFromWidget(int clickpos, const Window * const w, int widget, int padding) const
{
- uint pos = w->GetRowFromWidget(clickpos, widget, padding, line_height);
+ uint pos = w->GetRowFromWidget(clickpos, widget, padding, -1);
if (pos != INT_MAX) pos += this->GetPosition();
return (pos >= this->GetCount()) ? INT_MAX : pos;
}