mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-01 08:02:10 +01: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;
|
||||
}
|
||||
|
||||
|
||||
@@ -326,7 +326,7 @@ class editor_track
|
||||
static TTrack *create_switch(switch_template const &Template, std::vector<segment_data> const &Paths, TTrack const &Style, std::string const &Name = {});
|
||||
static TTrack *create_turntable(segment_data const &Path, TTrack const *Style, std::string const &Name);
|
||||
static void move_straights(std::vector<straight> const &Lines, std::vector<std::pair<glm::dvec3, glm::dvec3>> const &Ends);
|
||||
static std::vector<TTrack *> relay(chain const &Chain, std::vector<segment_data> const &Pieces);
|
||||
static std::vector<TTrack *> relay(chain const &Chain, std::vector<segment_data> const &Pieces, TTrack **Last = nullptr);
|
||||
static void retire(TTrack &Track);
|
||||
|
||||
static std::string material_name(material_handle const Material);
|
||||
|
||||
Reference in New Issue
Block a user