From fb0158c8cece2f161d2de6f75a295ad0725f8470 Mon Sep 17 00:00:00 2001 From: alberth Date: Sat, 14 Nov 2009 08:44:12 +0000 Subject: [PATCH] (svn r18067) -Codechange: Eliminate a constant representing a widget top edge in vehicle windows. --- src/vehicle_gui.cpp | 2 +- src/vehicle_gui_base.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index fea1ab403d..2f67b50234 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1030,7 +1030,7 @@ public: return; case VLW_WIDGET_LIST: { // Matrix to show vehicles - uint32 id_v = (pt.y - PLY_WND_PRC__OFFSET_TOP_WIDGET) / this->resize.step_height; + uint32 id_v = (pt.y - this->GetWidget(VLW_WIDGET_LIST)->pos_y) / this->resize.step_height; const Vehicle *v; if (id_v >= this->vscroll.GetCapacity()) return; // click out of bounds diff --git a/src/vehicle_gui_base.h b/src/vehicle_gui_base.h index 7cad956872..2f3757f4a8 100644 --- a/src/vehicle_gui_base.h +++ b/src/vehicle_gui_base.h @@ -16,7 +16,6 @@ /** Start of functions regarding vehicle list windows */ enum { - PLY_WND_PRC__OFFSET_TOP_WIDGET = 26, PLY_WND_PRC__SIZE_OF_ROW_TINY = 13, ///< Height of rows in group list PLY_WND_PRC__SIZE_OF_ROW_SMALL = 26, ///< Height of rows in train/roadvehicle list PLY_WND_PRC__SIZE_OF_ROW_BIG = 39, ///< Height of rows in ship/aircraft list