(svn r20223) -Codechange: Replace scrolled row calculations by a call to GetScrolledRowFromWidget().

This commit is contained in:
alberth
2010-07-26 13:08:48 +00:00
parent 97f85f7bfb
commit 4203e641f8
19 changed files with 58 additions and 134 deletions

View File

@@ -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) {