Changeset - r21348:1f4b1264fc26
[Not reviewed]
master
0 1 0
fonsinchen - 10 years ago 2014-04-05 14:28:55
fonsinchen@openttd.org
(svn r26445) -Change [FS#5961]: Draw links to match _settings_game.vehicle.road_side (M3Henry)
1 file changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/linkgraph/linkgraph_gui.cpp
Show inline comments
 
@@ -220,11 +220,12 @@ void LinkGraphOverlay::DrawContent(Point
 

	
 
	/* 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);
 
	}
 

	
0 comments (0 inline, 0 general)