From 9d27fd1ace0acf594cddd02a182558e251ff565f Mon Sep 17 00:00:00 2001 From: maj00r Date: Wed, 21 Oct 2026 11:47:25 +0200 Subject: [PATCH] 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. --- application/editormoderoute.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/editormoderoute.cpp b/application/editormoderoute.cpp index f6d7de55..bfc1771b 100644 --- a/application/editormoderoute.cpp +++ b/application/editormoderoute.cpp @@ -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)};