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

feat(editor): no sub-metre straights, switches snap, K splits path

This commit is contained in:
maj00r
2026-10-03 00:49:35 +02:00
parent 8a50d352fb
commit bf24c3983a
6 changed files with 200 additions and 11 deletions

View File

@@ -2768,6 +2768,20 @@ void editor_mode::on_key(int const Key, int const Scancode, int const Action, in
m_fill_points.pop_back();
break;
case GLFW_KEY_K:
if (is_press(Action) && ui()->mode() == nodebank_panel::TRACK && selected_track() != nullptr)
{
auto *track{selected_track()};
auto const parameter{editor_track::nearest_parameter(*track, Global.pCamera.Pos + GfxRenderer->Mouse_Position())};
auto const before{editor_track::capture(*track)};
if (auto *created{editor_track::split_path(*track, parameter)})
{
push_track_snapshot({{track, before}}, {created});
straight_refresh();
}
}
break;
case GLFW_KEY_F:
if (is_press(Action))
{