17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-01 08:02:10 +01:00

feat(editor): an end of a track dragged, and an end of a straight dragged by its handle, goes onto the ground at the height of the ballast, as a point laid; with Shift held it keeps its height

Selftest trackends: the ends of a track against the ground under them.
This commit is contained in:
maj00r
2026-10-24 18:45:47 +02:00
parent 9625b4b3d9
commit 11d1342181
7 changed files with 42 additions and 6 deletions

View File

@@ -604,7 +604,8 @@ void editor_mode::render_straight_gizmo()
glm::dvec3 const anchors[] = {line.start, line.end, (line.start + line.end) * 0.5};
glm::dvec3 handled{anchors[state.handle]};
bool const held{handle_drag_step(handled)};
// the ends go onto the ground, the middle moves the line in plan alone
bool const held{handle_drag_step(handled, state.handle == 2 ? nullptr : line.tracks.front())};
if (false == held && false == state.dragging)
return;