From 889f550eca52016a5f40508612bdc628f3530382 Mon Sep 17 00:00:00 2001 From: maj00r <73280030+maj00r@users.noreply.github.com> Date: Mon, 30 Nov 2026 20:44:37 +0100 Subject: [PATCH] fix(editor): any radius of a compound curve changed lays it at the speed of the line A curve a trace laid slower than the line kept that speed with its vertex until its radius was changed, but only the R1 field and the arc handle cleared it. The other radii of a compound curve (their fields, a radius added or taken out, the curve made compound or plain) changed the curve and left it at the speed of the radii it was fitted with. They now clear it too. --- application/editormoderoute.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/application/editormoderoute.cpp b/application/editormoderoute.cpp index 81e0d6e0e..2e652207a 100644 --- a/application/editormoderoute.cpp +++ b/application/editormoderoute.cpp @@ -2223,6 +2223,8 @@ bool editor_mode::render_route_vertex(int const Index) if (false == vertex.spirals && ImGui::Checkbox(STR_C("Compound curve (several radii)"), &vertex.compound)) { changed = true; + // the radii change: the speed a trace laid the curve slower for was of the ones it fitted + vertex.speed = 0.0; if (vertex.compound && vertex.arcs.empty()) vertex.arcs.push_back({std::max(10.0, std::round(vertex.radius * 0.6 / 10.0) * 10.0), 0.0, 1.0}); } @@ -2262,12 +2264,13 @@ bool editor_mode::render_route_vertex(int const Index) ImGui::TextDisabled("%.0f%%", percent(vertex.share)); changed |= arc_cant(0, vertex.first_cant); int removed{-1}; + bool radiichanged{false}; for (int k = 0; k < static_cast(vertex.arcs.size()); ++k) { auto &arc{vertex.arcs[k]}; ImGui::PushID(k); ImGui::Separator(); - changed |= ImGui::DragScalar(format(STR_C("Radius R%d (m)"), k + 2).c_str(), ImGuiDataType_Double, &arc.radius, 5.0f, nullptr, nullptr, "%.0f"); + radiichanged |= ImGui::DragScalar(format(STR_C("Radius R%d (m)"), k + 2).c_str(), ImGuiDataType_Double, &arc.radius, 5.0f, nullptr, nullptr, "%.0f"); mark(part::arc, k + 1); ImGui::SameLine(); if (ImGui::SmallButton("x")) @@ -2293,13 +2296,19 @@ bool editor_mode::render_route_vertex(int const Index) vertex.arcs.erase(vertex.arcs.begin() + removed); if (vertex.arcs.empty()) vertex.compound = false; - changed = true; + radiichanged = true; } if (ImGui::SmallButton(STR_C("Add a radius"))) { auto const last{vertex.arcs.empty() ? vertex.radius : vertex.arcs.back().radius}; vertex.arcs.push_back({std::max(10.0, std::round(last * 0.8 / 10.0) * 10.0), 0.0, 1.0}); + radiichanged = true; + } + // any of the radii changed, as R1: the curve laid at the speed of the line again + if (radiichanged) + { changed = true; + vertex.speed = 0.0; } item_tooltip("Another arc after the last one, the angle of the curve is shared out by the shares"); ImGui::Separator();