17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-02 10:29:13 +01:00

fix(editor): Ctrl+Z after a crossover laid along a curve leaves nothing behind, and such a crossover reaches from a transition onto the straight: the pieces the cut of the curve split off and then took out under a switch in the same step went into the history both as made and as taken out, so an undo retired them and brought them back, loose on top of the tracks put back (the curve seen chopped along its old path); now such a piece is neither, and push_track_snapshot drops a path that is both for every tool. The design of the grade line of the outer track, raised with the crossover, goes back with the undo as well (the step keeps the library of the designs), also when a crossover is moved or taken out for the route laid again. The frame a crossover along a curve is planned in goes on 250 m along the straights past the ends of the curve, and the release may fall on the straight of the other track: pressed near the end of the last transition and dragged towards the straight, its first switch ran past the end of the curve and the crossover was refused ("A switch of the connection runs off the end of its straight"); the first switch is drawn along that frame as it's dragged. The insert takes the style and the name of the track pressed on

This commit is contained in:
maj00r
2026-10-25 17:26:05 +01:00
parent f83a1a0cd2
commit aca659754b
7 changed files with 182 additions and 15 deletions

View File

@@ -1554,7 +1554,9 @@ class editor_mode : public application_mode, private editor_track::observer, pri
void insert_curved_switch(int const Direction, int const Side);
// a crossover between two tracks running side by side along a curve (editormodeconnectioncurve.cpp)
struct curve_mapping;
static bool curve_of(TTrack &Track, editor_track::straight_tolerance const &Tolerance, double const Gauge, std::vector<curve_sample> &Frame, std::vector<TTrack *> &Tracks);
// Beyond: the straights past the ends of the curve go with it up to that far, and a straight track that near the curve is taken
// as its part
static bool curve_of(TTrack &Track, editor_track::straight_tolerance const &Tolerance, double const Gauge, std::vector<curve_sample> &Frame, std::vector<TTrack *> &Tracks, double const Beyond = 0.0);
static void cut_curve(std::vector<TTrack *> &Candidates, std::vector<curve_sample> const &Frame, glm::dvec3 const &First, glm::dvec3 const &Second, std::vector<std::pair<TTrack *, editor_track::state>> &States, std::vector<TTrack *> &Created, std::vector<TTrack *> &Removed);
void insert_curved_connection();
struct curved_crossover
@@ -2453,6 +2455,10 @@ class editor_mode : public application_mode, private editor_track::observer, pri
bool m_profiles_loaded{false};
void profile_library_load();
void profile_library_mark(std::vector<scene::layer_handle> Layers);
// the last step takes the kept grade lines back to the library given, as they were before it changed them
void profiles_to_history(std::vector<stored_profile> Library);
// the kept grade lines back to the library given, the step changing them given up before it went to the history
void profiles_restore(std::vector<stored_profile> Library);
// the tracks whose grade line was fitted, by name, with the shape they had then, kept as "//$f" comment lines: a track
// changed since, by hand or taken back, isn't fitted any more
struct fitted_mark