mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 10:59:20 +02:00
fix(editor): the route design keeps its whole fragment after Apply: the last path of the line is the one holding the last piece, not the original end path holding the first piece of its group, so a second Apply (e.g. after changing the share of a compound curve) no longer re-lays only the front part and leaves the old tail lying next to the new paths; the same for the curve laid with the straight tool
This commit is contained in:
@@ -2912,7 +2912,7 @@ void editor_track::move_straight(straight const &Line, glm::dvec3 const &Start,
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<TTrack *> editor_track::relay(chain const &Chain, std::vector<segment_data> const &Pieces)
|
||||
std::vector<TTrack *> editor_track::relay(chain const &Chain, std::vector<segment_data> const &Pieces, TTrack **Last)
|
||||
{
|
||||
std::vector<TTrack *> created;
|
||||
auto const count{Chain.tracks.size()};
|
||||
@@ -2943,6 +2943,8 @@ std::vector<TTrack *> editor_track::relay(chain const &Chain, std::vector<segmen
|
||||
tracks.push_back(track);
|
||||
}
|
||||
commit(tracks);
|
||||
if (Last != nullptr)
|
||||
*Last = tracks.back();
|
||||
return created;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user