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
commit70025a149dedc6bcd7c70cb40492af7f4095f208 (patch)
tree37c6c267de872fae3e7188d52acfee6027ef1a11 /src/autoreplace_gui.cpp
parent22a7b95c100bc87cf2503314668ed658e1adc673 (diff)
downloadopenttd-70025a149dedc6bcd7c70cb40492af7f4095f208.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) {