From: Mikko Rasa Date: Sun, 19 May 2013 12:31:46 +0000 (+0300) Subject: Don't zero slope for tracks not connected on both ends X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=c6cd59c4d40706ccd0f894fee3dc11c48dd20a38;p=r2c2.git Don't zero slope for tracks not connected on both ends Since check_slope is now called implicitly when linking tracks together, loading layouts with sloped tracks wasn't working properly. --- diff --git a/source/libr2c2/track.cpp b/source/libr2c2/track.cpp index 7b5e1a2..c92ff37 100644 --- a/source/libr2c2/track.cpp +++ b/source/libr2c2/track.cpp @@ -106,7 +106,6 @@ void Track::check_slope() } else { - slope = 0; if(links[0]) { Vector epp = links[0]->get_snap_node(links[0]->get_link_slot(*this)).position; @@ -115,7 +114,7 @@ void Track::check_slope() else if(links[1]) { Vector epp = links[1]->get_snap_node(links[1]->get_link_slot(*this)).position; - position.z = epp.z; + position.z = epp.z-slope; } } }