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();