mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-20 01:04:59 +01:00
feat(editor): the points of the roads picked on the screen, also under the terrain; Alt+drag their height
The points where the pieces of a road meet were picked only by the ground clicked: one more than 3 m above or below the ground under the cursor (a road taken down into a cutting, under an embankment) couldn't be picked again. Now the point nearest to the cursor on the screen (within 12 px, the one nearer to the camera of those about as near) is picked first, the ground as before after it. Alt+LMB on a point and dragging up or down changes the height of the selected points (Ctrl: ten times finer); the change shows as yellow lines and a label by the cursor while dragging, and is applied, as one step of the history, when the button is let go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DDcMn1Q7wdYkbxDUWscNHZ
This commit is contained in:
@@ -5518,6 +5518,18 @@ void editor_mode::on_mouse_button(int const Button, int const Action, int const
|
||||
// with the road window open the left button works its tools, whichever edit mode is on but the track one
|
||||
if (m_roadtool.window && Button == GLFW_MOUSE_BUTTON_LEFT && ui()->mode() != nodebank_panel::TRACK)
|
||||
{
|
||||
// Alt+LMB on a point: its height (and the other selected ones') dragged up or down
|
||||
if (is_press(Action) && Global.altState && false == ImGui::GetIO().WantCaptureMouse && road_lift_start())
|
||||
{
|
||||
m_input.mouse.button(Button, Action);
|
||||
return;
|
||||
}
|
||||
if (false == is_press(Action) && m_roadtool.lifting)
|
||||
{
|
||||
road_lift_finish();
|
||||
m_input.mouse.button(Button, Action);
|
||||
return;
|
||||
}
|
||||
if (is_press(Action))
|
||||
{
|
||||
// NOTE: the pick is resolved a few frames later, by then it's known whether the press was meant for the UI
|
||||
|
||||
Reference in New Issue
Block a user