summaryrefslogtreecommitdiff
path: root/src/autoreplace_gui.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-01-18 18:18:39 +0000
committerpeter1138 <peter1138@openttd.org>2008-01-18 18:18:39 +0000
commitaa556f123dd2401c61373c835afea8fbfeb2499e (patch)
tree37c6c267de872fae3e7188d52acfee6027ef1a11 /src/autoreplace_gui.cpp
parent66a0fafc93ca4ab9b8c5d2ee8548d2bb0f8426df (diff)
downloadopenttd-aa556f123dd2401c61373c835afea8fbfeb2499e.tar.xz
(svn r11918) -Codechange: Draw engine lists at widget positions instead of fixed pixel positions
Diffstat (limited to 'src/autoreplace_gui.cpp')
-rw-r--r--src/autoreplace_gui.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp
index 448a48c81..29a7490cf 100644
--- a/src/autoreplace_gui.cpp
+++ b/src/autoreplace_gui.cpp
@@ -334,13 +334,13 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
/* Draw the lists */
for(byte i = 0; i < 2; i++) {
- uint16 x = i == 0 ? 2 : 230; // at what X offset
+ uint widget = (i == 0) ? RVW_WIDGET_LEFT_MATRIX : RVW_WIDGET_RIGHT_MATRIX;
EngineList list = WP(w, replaceveh_d).list[i]; // which list to draw
EngineID start = i == 0 ? w->vscroll.pos : w->vscroll2.pos; // what is the offset for the start (scrolling)
EngineID end = min((i == 0 ? w->vscroll.cap : w->vscroll2.cap) + start, EngList_Count(&list));
/* Do the actual drawing */
- DrawEngineList((VehicleType)w->window_number, x, 15, list, start, end, WP(w, replaceveh_d).sel_engine[i], i == 0, selected_group);
+ DrawEngineList((VehicleType)w->window_number, w->widget[widget].left + 2, w->widget[widget].top + 1, list, start, end, WP(w, replaceveh_d).sel_engine[i], i == 0, selected_group);
/* Also draw the details if an engine is selected */
if (WP(w, replaceveh_d).sel_engine[i] != INVALID_ENGINE) {