summaryrefslogtreecommitdiff
path: root/src/subsidy_gui.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-07-26 13:08:48 +0000
committeralberth <alberth@openttd.org>2010-07-26 13:08:48 +0000
commit4203e641f8a507c017d10bf40f2c3882ce596da5 (patch)
tree883a2b182b8594de0b2048900956281c4efff861 /src/subsidy_gui.cpp
parent97f85f7bfba286bf9a7c692b390eec8231cac9ae (diff)
downloadopenttd-4203e641f8a507c017d10bf40f2c3882ce596da5.tar.xz
(svn r20223) -Codechange: Replace scrolled row calculations by a call to GetScrolledRowFromWidget().
Diffstat (limited to 'src/subsidy_gui.cpp')
-rw-r--r--src/subsidy_gui.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp
index 0528ea146..09c43bd84 100644
--- a/src/subsidy_gui.cpp
+++ b/src/subsidy_gui.cpp
@@ -41,11 +41,7 @@ struct SubsidyListWindow : Window {
{
if (widget != SLW_PANEL) return;
- int y = (pt.y - this->GetWidget<NWidgetBase>(SLW_PANEL)->pos_y - WD_FRAMERECT_TOP) / this->resize.step_height;
- if (!IsInsideMM(y, 0, this->vscroll.GetCapacity())) return;
-
- y += this->vscroll.GetPosition();
-
+ int y = this->vscroll.GetScrolledRowFromWidget(pt.y, this, SLW_PANEL, WD_FRAMERECT_TOP);
int num = 0;
const Subsidy *s;
FOR_ALL_SUBSIDIES(s) {