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

Draw the track plan on the scenery instead of on a canvas

The plan panel had its own 2D canvas, which was the wrong place for it: the
layout is drawn on the scenery. The canvas is gone. Points are laid by
clicking the ground under the cursor, the solved geometry is painted over
the rendered world through the colour pass camera, and the panel keeps only
the controls - fits, storage and what is being edited.

The left button belongs to the plan tool while it is up, so a click no
longer also picks or places a scenery node. Clicks landing on a panel stay
with the panel.

With no georeference set the plan frame and the world share an origin, so
easting runs along world x and northing against world z.
This commit is contained in:
maj00r
2026-07-31 19:21:05 +02:00
committed by maj00r
parent db49039b9d
commit 3fbc1aaaaf
3 changed files with 169 additions and 207 deletions

View File

@@ -1591,6 +1591,14 @@ void editor_mode::on_mouse_button(int const Button, int const Action, int const
return;
}
// while the plan tool is up the left button belongs to it: it lays and moves the points of the
// track layout, so it must not also pick or place scenery nodes
if (Global.editor_ortho && Button == GLFW_MOUSE_BUTTON_LEFT)
{
m_input.mouse.button(Button, Action);
return;
}
// in chunk-edit mode the left button adds a neighbouring chunk (Shift = delete the clicked one)
if (m_chunk_edit && Button == GLFW_MOUSE_BUTTON_LEFT)
{