mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-30 06:10:28 +01:00
fix(editor): a touchpad no longer flips through the shapes nor throws the zoom far out
A touchpad under Wayland sends a scroll as many fractions of a notch. Shift+wheel took each of them for a step and went round the shapes of the laid track, the joins and the connections several times in one swipe; now the fractions are gathered into whole notches and a gesture moves such a choice one step. Ctrl+wheel steps the radius once a notch. The 3D zoom measured to the level 0 when nothing was under the cursor, which in a scenery on the terrain model lies far below or kilometres ahead, so a light swipe at the horizon flew the camera away. It measures to the ground under the camera now, backs away by no more than four heights of the camera over it, and takes at most two notches at a time. Self-test laystate tells the shape, the radius and the camera.
This commit is contained in:
@@ -1476,6 +1476,17 @@ class editor_mode : public application_mode, private editor_track::observer
|
||||
editor_track::point_ref m_join_point;
|
||||
mutable alignment::join_result m_join_last;
|
||||
bool track_wheel(double const Offset);
|
||||
// a touchpad sends fractions of a notch: a choice moves a step for each whole notch gathered, and only one in a gesture when
|
||||
// Gesture; a pause, another key or the other way starts over
|
||||
struct wheel_state
|
||||
{
|
||||
double rest{0.0};
|
||||
double time{-10.0};
|
||||
int keys{0};
|
||||
bool spent{false};
|
||||
};
|
||||
wheel_state m_wheel;
|
||||
int wheel_step(double const Offset, bool const Gesture);
|
||||
std::string track_shaping(bool const Joined) const;
|
||||
void render_layout_combo();
|
||||
double design_speed(TTrack const *From, TTrack const *To) const;
|
||||
|
||||
Reference in New Issue
Block a user