diff options
author | frosch <frosch@openttd.org> | 2017-12-10 13:48:06 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2017-12-10 13:48:06 +0000 |
commit | c14f23a03d6aa3b360f2e9e31fe88483e5df6a11 (patch) | |
tree | c93af47c8f602079ee4e3ed18fac184339dea785 | |
parent | 6f36c52736d28a5aaf8e8066111a2a5421fe2cf5 (diff) | |
download | openttd-c14f23a03d6aa3b360f2e9e31fe88483e5df6a11.tar.xz |
(svn r27937) -Change: When train depots have a horizontal scrollbar, allow scrolling 1 tile beyond the longest train, so you can actually attach a wagon at the end.
-rw-r--r-- | src/depot_gui.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 15291f6b6..3253dacff 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -384,11 +384,11 @@ struct DepotWindow : Window { int image_left = rtl ? r.left + this->count_width : r.left + this->header_width; int image_right = rtl ? r.right - this->header_width : r.right - this->count_width; if (rtl) { - for (int x = image_right - w; x > image_left; x -= w) { + for (int x = image_right - w; x >= image_left; x -= w) { GfxDrawLine(x, r.top, x, r.bottom, col, 1, 3); } } else { - for (int x = image_left + w; x < image_right; x += w) { + for (int x = image_left + w; x <= image_right; x += w) { GfxDrawLine(x, r.top, x, r.bottom, col, 1, 3); } } @@ -734,7 +734,8 @@ struct DepotWindow : Window { } /* Always have 1 empty row, so people can change the setting of the train */ this->vscroll->SetCount(this->vehicle_list.Length() + this->wagon_list.Length() + 1); - this->hscroll->SetCount(max_width); + /* Always make it longer than the longest train, so you can attach vehicles at the end, and also see the next vertical tile separator line */ + this->hscroll->SetCount(max_width + ScaleGUITrad(2 * VEHICLEINFO_FULL_VEHICLE_WIDTH + 1)); } else { this->vscroll->SetCount(CeilDiv(this->vehicle_list.Length(), this->num_columns)); } |