17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 05:09:20 +02:00

fix(editor): keep straight handle selected after drag

This commit is contained in:
maj00r
2026-10-02 22:53:04 +02:00
parent 9198840d0f
commit 90f03849c0

View File

@@ -1380,7 +1380,8 @@ bool editor_mode::pick_straight_handle()
void editor_mode::straight_refresh() void editor_mode::straight_refresh()
{ {
auto &state{m_straights}; auto &state{m_straights};
state.current_for = nullptr; state.current_for = selected_track();
state.current = state.current_for != nullptr ? editor_track::find_straight(*state.current_for, state.tolerance) : editor_track::straight{};
for (auto *line : {&state.a, &state.b}) for (auto *line : {&state.a, &state.b})
if (false == line->tracks.empty()) if (false == line->tracks.empty())
*line = editor_track::find_straight(*line->tracks.front(), state.tolerance); *line = editor_track::find_straight(*line->tracks.front(), state.tolerance);