summaryrefslogtreecommitdiff
path: root/src/depot_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2017-12-10 13:48:49 +0000
committerfrosch <frosch@openttd.org>2017-12-10 13:48:49 +0000
commit42392fd7b505215bef771b98e66404cce2227155 (patch)
tree7dae03a65dbc9b58d0bae1aff2f04ce0ab758a52 /src/depot_gui.cpp
parentc14f23a03d6aa3b360f2e9e31fe88483e5df6a11 (diff)
downloadopenttd-42392fd7b505215bef771b98e66404cce2227155.tar.xz
(svn r27938) -Fix (r27899): When scrolling in the train depot, also scroll the tile separators.
Diffstat (limited to 'src/depot_gui.cpp')
-rw-r--r--src/depot_gui.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp
index 3253dacff..14461d881 100644
--- a/src/depot_gui.cpp
+++ b/src/depot_gui.cpp
@@ -383,12 +383,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);
}
}