summaryrefslogtreecommitdiff
path: root/src/train_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-11-23 16:18:01 +0000
committerrubidium <rubidium@openttd.org>2009-11-23 16:18:01 +0000
commitfabd1b7c5024f4dce2b4af33678ade4d21d6223e (patch)
treebb5d173a048e5b66d414a173c3df761b1ceac4d9 /src/train_gui.cpp
parent4b555968c402e3c17cd2cd023f9544917a102992 (diff)
downloadopenttd-fabd1b7c5024f4dce2b4af33678ade4d21d6223e.tar.xz
(svn r18256) -Codechange: make the vehicle details window big font aware
Diffstat (limited to 'src/train_gui.cpp')
-rw-r--r--src/train_gui.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/train_gui.cpp b/src/train_gui.cpp
index 65f46d30d..38a5d9b0f 100644
--- a/src/train_gui.cpp
+++ b/src/train_gui.cpp
@@ -240,6 +240,7 @@ void DrawTrainDetails(const Train *v, int left, int right, int y, int vscroll_po
Direction dir = rtl ? DIR_E : DIR_W;
const Train *u = v;
int x = rtl ? right : left;
+ int sprite_y_offset = 4 + (FONT_HEIGHT_NORMAL - 10) / 2;
for (;;) {
if (--vscroll_pos < 0 && vscroll_pos >= -vscroll_cap) {
int px = x;
@@ -249,7 +250,7 @@ void DrawTrainDetails(const Train *v, int left, int right, int y, int vscroll_po
Point offset;
int width = u->GetDisplayImageWidth(&offset);
SpriteID pal = (u->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(u);
- DrawSprite(u->GetImage(dir), pal, px + (rtl ? -offset.x : offset.x), y + 4 + offset.y);
+ DrawSprite(u->GetImage(dir), pal, px + (rtl ? -offset.x : offset.x), y + sprite_y_offset + offset.y);
px += rtl ? -width : width;
u = u->Next();
} while (u != NULL && u->IsArticulatedPart() && u->cargo_cap == 0);