(svn r8770) -Fix r8661: corrected some aircraft sprite placement issues in the depot window
authorbjarni
Sat, 17 Feb 2007 11:17:49 +0000
changeset 6043 1b3713750b05
parent 6042 4e7e4d618cae
child 6044 e9e318238ad6
(svn r8770) -Fix r8661: corrected some aircraft sprite placement issues in the depot window
src/depot_gui.cpp
--- a/src/depot_gui.cpp	Sat Feb 17 10:21:48 2007 +0000
+++ b/src/depot_gui.cpp	Sat Feb 17 11:17:49 2007 +0000
@@ -185,8 +185,9 @@
 		case VEH_Ship:     DrawShipImage(    v, x + 19, sprite_y - 1, WP(w, depot_d).sel); break;
 		case VEH_Aircraft: {
 			const Sprite *spr = GetSprite(GetAircraftImage(v, DIR_W));
-			int diff_y = spr->y_offs + spr->height - 12;
-			DrawAircraftImage(v, x + 12, y + diff_y, WP(w, depot_d).sel);
+			DrawAircraftImage(v, x + 12,
+							  y + max(spr->height + spr->y_offs - 14, 0), // tall sprites needs an y offset
+							  WP(w, depot_d).sel);
 		} break;
 		default: NOT_REACHED();
 	}