From 4203e641f8a507c017d10bf40f2c3882ce596da5 Mon Sep 17 00:00:00 2001 From: alberth Date: Mon, 26 Jul 2010 13:08:48 +0000 Subject: (svn r20223) -Codechange: Replace scrolled row calculations by a call to GetScrolledRowFromWidget(). --- src/subsidy_gui.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/subsidy_gui.cpp') 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(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) { -- cgit v1.2.3-54-g00ecf