18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-20 01:04:59 +01:00

fix(editor): a road point picked on the screen only when nothing is under the cursor, and not through it; Alt+drag dropped with Esc, the work area or the window, no undo in the middle of it

The click takes the point by the ground clicked, then the piece or the junction under the cursor; the point nearest on the
screen only when there's none, no farther than what is under the cursor and a bit beyond it, by whole pixels first and
the range then, so the order of the roads doesn't decide. The ends of the pieces are gone through without looking for the
repeated ones (editor_road::each_joint), joints() isn't needed. Esc, the road window closed, another tool or the track work
area drop the drag; Ctrl+Z and Ctrl+Y wait for its end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDcMn1Q7wdYkbxDUWscNHZ
This commit is contained in:
Claude
2026-11-11 11:38:15 +01:00
parent 6684baefc3
commit b8b6b3aa76
4 changed files with 44 additions and 38 deletions

View File

@@ -5351,7 +5351,7 @@ void editor_mode::on_key(int const Key, int const Scancode, int const Action, in
return;
// shortcuts: undo/redo. not in the middle of a drag, it would go on from the state which was undone
if (Global.ctrlState && (Key == GLFW_KEY_Z || Key == GLFW_KEY_Y) && is_press(Action) && (m_track_gizmo_using || m_track_set_using || m_straights.dragging || m_extend.active || m_switch.placing || m_point_drag.active || m_handle_drag.active))
if (Global.ctrlState && (Key == GLFW_KEY_Z || Key == GLFW_KEY_Y) && is_press(Action) && (m_track_gizmo_using || m_track_set_using || m_straights.dragging || m_extend.active || m_switch.placing || m_point_drag.active || m_handle_drag.active || m_roadtool.lifting))
return;
if (Global.ctrlState && Key == GLFW_KEY_Z && is_press(Action))
{