(svn r20221) -Codechange: Move unscrolled row calculation into a function.

This commit is contained in:
alberth
2010-07-26 13:02:28 +00:00
parent 80cc566553
commit 3a1451644a
4 changed files with 20 additions and 4 deletions

View File

@@ -259,8 +259,7 @@ public:
{
switch (widget) {
case TWA_COMMAND_LIST: {
int y = (pt.y - this->GetWidget<NWidgetBase>(TWA_COMMAND_LIST)->pos_y - 1) / FONT_HEIGHT_NORMAL;
int y = this->GetRowFromWidget(pt.y, TWA_COMMAND_LIST, 1, FONT_HEIGHT_NORMAL);
if (!IsInsideMM(y, 0, 5)) return;
y = GetNthSetBit(GetMaskOfTownActions(NULL, _local_company, this->town), y + this->vscroll.GetPosition() - 1);