mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 15:41:15 +00:00
(svn r24351) -Fix: Short vehicles were not properly positioned at the cursor when dragging for RTL languages.
This commit is contained in:
parent
526c4e8af0
commit
90b539818f
@ -480,13 +480,14 @@ struct DepotWindow : Window {
|
|||||||
this->sel = INVALID_VEHICLE;
|
this->sel = INVALID_VEHICLE;
|
||||||
TrainDepotMoveVehicle(v, sel, gdvp.head);
|
TrainDepotMoveVehicle(v, sel, gdvp.head);
|
||||||
} else if (v != NULL) {
|
} 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);
|
SetObjectToPlaceWnd(image, GetVehiclePalette(v), HT_DRAG, this);
|
||||||
|
|
||||||
this->sel = v->index;
|
this->sel = v->index;
|
||||||
this->SetDirty();
|
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;
|
_cursor.vehchain = _ctrl_pressed;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user