1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 09:09:09 +00:00

(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

@@ -249,13 +249,10 @@ public:
switch (widget) {
default: break;
case BBSW_BRIDGE_LIST: {
uint i = ((int)pt.y - this->GetWidget<NWidgetBase>(BBSW_BRIDGE_LIST)->pos_y) / this->resize.step_height;
if (i < this->vscroll.GetCapacity()) {
i += this->vscroll.GetPosition();
if (i < this->bridges->Length()) {
this->BuildBridge(i);
delete this;
}
uint i = this->vscroll.GetScrolledRowFromWidget(pt.y, this, BBSW_BRIDGE_LIST);
if (i < this->bridges->Length()) {
this->BuildBridge(i);
delete this;
}
} break;