Merge branch 'master' into jgrpp

This commit is contained in:
Jonathan G Rennison
2018-01-14 23:22:47 +00:00
41 changed files with 306 additions and 261 deletions

View File

@@ -385,12 +385,13 @@ struct DepotWindow : Window {
int col = _colour_gradient[wid->colour][4];
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;
int first_line = w + (-this->hscroll->GetPosition()) % w;
if (rtl) {
for (int x = image_right - w; x > image_left; x -= w) {
for (int x = image_right - first_line; 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 + first_line; x <= image_right; x += w) {
GfxDrawLine(x, r.top, x, r.bottom, col, 1, 3);
}
}
@@ -736,7 +737,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));
}