17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-26 19:24:54 +01:00

fix(editor): a straight dragged by its free end past a curve isn't refused

When the refitted curve needed more of the straight at its other end,
the ends of the line were both checked against the design, and the free
end that went along with the drag "missed" by as far as it was dragged.
Only an end whose straight was cut is checked now. The longer transition
curves of the PKP PLK norms ran into it more often.
This commit is contained in:
maj00r
2026-10-21 11:47:25 +02:00
parent 825c91705d
commit 9d27fd1ace

View File

@@ -722,8 +722,8 @@ void editor_mode::route_apply()
to = editor_track::take_straight(editor_track::straight_beyond(before, true, m_straights.tolerance), to, before.end, route.result.end, states, created);
std::string error;
auto const found{editor_track::find_chain(from, to, chain, error, true)};
auto const startoff{found ? plan_distance(chain.start, route.result.start) : 0.0};
auto const endoff{found ? plan_distance(chain.end, route.result.end) : 0.0};
auto const startoff{found && startextension > 0.0 ? plan_distance(chain.start, route.result.start) : 0.0};
auto const endoff{found && endextension > 0.0 ? plan_distance(chain.end, route.result.end) : 0.0};
if (false == found || startoff > 5.0 || endoff > 5.0)
{
auto const startrun{editor_track::straight_beyond(before, false, m_straights.tolerance)};