summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfonsinchen <fonsinchen@openttd.org>2014-04-05 14:28:55 +0000
committerfonsinchen <fonsinchen@openttd.org>2014-04-05 14:28:55 +0000
commit782b9f01cb1ebd178cc877c65e1dd0a94a30f98a (patch)
treeb294096f968ea9f2786b2d2589baa4ddfbd081b3
parenta336f24c7d4bf8a1e47eec910a528cacf4ff1f40 (diff)
downloadopenttd-782b9f01cb1ebd178cc877c65e1dd0a94a30f98a.tar.xz
(svn r26445) -Change [FS#5961]: Draw links to match _settings_game.vehicle.road_side (M3Henry)
-rw-r--r--src/linkgraph/linkgraph_gui.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/linkgraph/linkgraph_gui.cpp b/src/linkgraph/linkgraph_gui.cpp
index ae4cdee1a..f75f602ab 100644
--- a/src/linkgraph/linkgraph_gui.cpp
+++ b/src/linkgraph/linkgraph_gui.cpp
@@ -220,11 +220,12 @@ void LinkGraphOverlay::DrawContent(Point pta, Point ptb, const LinkProperties &c
/* Move line a bit 90° against its dominant direction to prevent it from
* being hidden below the grey line. */
+ int side = _settings_game.vehicle.road_side ? 1 : -1;
if (abs(pta.x - ptb.x) < abs(pta.y - ptb.y)) {
- int offset_x = (pta.y > ptb.y ? 1 : -1) * this->scale;
+ int offset_x = (pta.y > ptb.y ? 1 : -1) * side * this->scale;
GfxDrawLine(pta.x + offset_x, pta.y, ptb.x + offset_x, ptb.y, colour, this->scale, dash);
} else {
- int offset_y = (pta.x < ptb.x ? 1 : -1) * this->scale;
+ int offset_y = (pta.x < ptb.x ? 1 : -1) * side * this->scale;
GfxDrawLine(pta.x, pta.y + offset_y, ptb.x, ptb.y + offset_y, colour, this->scale, dash);
}