diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-10-20 17:53:21 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-10-20 17:53:21 +0200 |
commit | 39e209983bd1f04fb0beefef754d7430c8b7fb9f (patch) | |
tree | ec41545dda2d33d316adc6466f21138a280db6a8 /logic/mappings.cpp | |
parent | 092e2910ae8f6c2e188e930b9540d58e145c9142 (diff) |
logic, spline: more spline work/fixes
- mapping window clamps are now value<max_clamp> in
spline
- clamp won't mess up saved spline content
- clean up artifacts on spline widget
Diffstat (limited to 'logic/mappings.cpp')
-rw-r--r-- | logic/mappings.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/logic/mappings.cpp b/logic/mappings.cpp index 9e81bb01..8144f9b4 100644 --- a/logic/mappings.cpp +++ b/logic/mappings.cpp @@ -2,18 +2,13 @@ #include <utility> -Map::Map(QString primary, QString secondary, int max_x, int max_y, axis_opts& opts) : +Map::Map(const QString& spline_name, const QString& alt_spline_name, axis_opts& opts) : opts(opts), - name1(primary), - name2(secondary), - spline_main(max_x, max_y, primary), - spline_alt(max_x, max_y, secondary) + name(spline_name), + alt_name(alt_spline_name), + spline_main(spline_name, opts.prefix(), opts.axis()), + spline_alt(alt_spline_name, opts.prefix(), opts.axis()) { - spline_main.set_max_input(max_x); - spline_alt.set_max_input(max_x); - - spline_main.set_max_output(max_y); - spline_alt.set_max_output(max_y); } void Map::save() @@ -30,11 +25,11 @@ void Map::load() Mappings::Mappings(std::vector<axis_opts*> opts) : axes { - Map("spline-X", "alt-spline-X", 100, 75, *opts[TX]), - Map("spline-Y", "alt-spline-Y", 100, 75, *opts[TY]), - Map("spline-Z", "alt-spline-Z", 100, 75, *opts[TZ]), - Map("spline-yaw", "alt-spline-yaw", 180, 180, *opts[Yaw]), - Map("spline-pitch", "alt-spline-pitch", 180, std::abs((int)opts[Pitch]->clamp_y), *opts[Pitch]), - Map("spline-roll", "alt-spline-roll", 180, 180, *opts[Roll]) + Map("spline-X", "alt-spline-X", *opts[TX]), + Map("spline-Y", "alt-spline-Y", *opts[TY]), + Map("spline-Z", "alt-spline-Z", *opts[TZ]), + Map("spline-yaw", "alt-spline-yaw", *opts[Yaw]), + Map("spline-pitch", "alt-spline-pitch", *opts[Pitch]), + Map("spline-roll", "alt-spline-roll", *opts[Roll]) } {} |