1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-17 09:22:42 +01:00

(svn r24422) [1.2] -Backport from trunk:

- Fix: When airport construction was denied due to noise, the error message named the wrong town (r24354)
- Fix: [NoAI] A TileIndex is not a station id, so do not use it as one [FS#5215] (r24353)
- Fix: When highlighting the drop position for vehicles in depots, make space for all articulated parts (r24352)
- Fix: Short vehicles were not properly positioned at the cursor when dragging for RTL languages (r24351)
This commit is contained in:
rubidium
2012-07-20 19:39:06 +00:00
parent fc11459405
commit 975b6de604
4 changed files with 13 additions and 7 deletions

View File

@@ -61,8 +61,10 @@ static int HighlightDragPosition(int px, int max_width, VehicleID selection)
bool rtl = _current_text_dir == TD_RTL;
assert(selection != INVALID_VEHICLE);
Point offset;
int dragged_width = Train::Get(selection)->GetDisplayImageWidth(&offset) + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
int dragged_width = WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
for (Train *t = Train::Get(selection); t != NULL; t = t->HasArticulatedPart() ? t->GetNextArticulatedPart() : NULL) {
dragged_width += t->GetDisplayImageWidth(NULL);
}
int drag_hlight_left = rtl ? max(px -dragged_width, 0) : px;
int drag_hlight_right = rtl ? px : min(px + dragged_width, max_width);