mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-03 22:22:04 +01:00
feat(editor): with the gizmo hidden a track is changed by its ends only: its control vectors are neither drawn nor caught until Q, W, E or the buttons above the view bring the gizmo out, so a track selected won't bend by chance; the hints say what dragging an end does (a joint: the neighbours follow, a free end: a new track out of it, with Ctrl it moves). The tutorial has a lesson of its own for editing with the gizmo, after the one of selecting and fixing, which no longer speaks of it: the arrows, the rings, the handles, the control vectors, a point clicked, Ctrl and Esc, ticked off when the gizmo is out and a track bent or moved with it; thirteen lessons. Also puts back in place two lines of the band of the curvature which dd64b821 committed out of their place (the arc declared inside the loop, so that commit didn't compile)
This commit is contained in:
@@ -1741,12 +1741,12 @@ bool editor_mode::render_route_band()
|
||||
// ones of no length yet
|
||||
int under{-1};
|
||||
int part{0};
|
||||
int arc{0};
|
||||
if (hovered && false == dragging)
|
||||
{
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
auto const &element{result.elements[i]};
|
||||
int arc{0};
|
||||
if (mouse.x < x_of(element.chainage) || mouse.x >= x_of(element.chainage + element.length))
|
||||
continue;
|
||||
under = i;
|
||||
@@ -1810,12 +1810,12 @@ bool editor_mode::render_route_band()
|
||||
}
|
||||
else
|
||||
{
|
||||
// the transition in grows to the left, from where it starts; the others to the right
|
||||
auto const shift{(mouse.x - band.press.x) / std::max(1e-6f, metres)};
|
||||
wanted = std::max(0.0, std::round(band.value + (band.part == 2 ? -shift : shift)));
|
||||
}
|
||||
if (wanted != value)
|
||||
{
|
||||
// the transition in grows to the left, from where it starts; the others to the right
|
||||
value = wanted;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user