changeset 19448:842691e2e353 draft

(svn r24351) -Fix: Short vehicles were not properly positioned at the cursor when dragging for RTL languages.
author frosch <frosch@openttd.org>
date Sat, 23 Jun 2012 14:31:58 +0000
parents 5a79b75b0ffa
children 0cc21f48ebe7
files src/depot_gui.cpp
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/depot_gui.cpp
+++ b/src/depot_gui.cpp
@@ -480,13 +480,14 @@
 					this->sel = INVALID_VEHICLE;
 					TrainDepotMoveVehicle(v, sel, gdvp.head);
 				} else if (v != NULL) {
-					int image = v->GetImage(_current_text_dir == TD_RTL ? DIR_E : DIR_W, EIT_IN_DEPOT);
+					bool rtl = _current_text_dir == TD_RTL;
+					int image = v->GetImage(rtl ? DIR_E : DIR_W, EIT_IN_DEPOT);
 					SetObjectToPlaceWnd(image, GetVehiclePalette(v), HT_DRAG, this);
 
 					this->sel = v->index;
 					this->SetDirty();
 
-					_cursor.short_vehicle_offset = v->IsGroundVehicle() ? 16 - v->GetGroundVehicleCache()->cached_veh_length * 2 : 0;
+					_cursor.short_vehicle_offset = v->IsGroundVehicle() ? (16 - v->GetGroundVehicleCache()->cached_veh_length * 2) * (rtl ? -1 : 1) : 0;
 					_cursor.vehchain = _ctrl_pressed;
 				}
 				break;