summaryrefslogtreecommitdiffhomepage
path: root/logic
diff options
context:
space:
mode:
Diffstat (limited to 'logic')
-rw-r--r--logic/main-settings.cpp3
-rw-r--r--logic/mappings.cpp11
2 files changed, 10 insertions, 4 deletions
diff --git a/logic/main-settings.cpp b/logic/main-settings.cpp
index a706abe6..5cb6e64e 100644
--- a/logic/main-settings.cpp
+++ b/logic/main-settings.cpp
@@ -68,7 +68,8 @@ axis_opts::axis_opts(bundle b_settings_window, bundle b_mapping_window, QString
src(b_settings_window, n(pfx, "source-index"), idx),
invert(b_settings_window, n(pfx, "invert-sign"), false),
altp(b_mapping_window, n(pfx, "alt-axis-sign"), false),
- clamp(b_mapping_window, n(pfx, "max-value"), idx >= Yaw ? r180 : t30)
+ clamp_x(b_mapping_window, n(pfx, "max-value"), idx >= Yaw ? r180 : t30),
+ clamp_y(b_mapping_window, n(pfx, "max-output-value"), idx >= Yaw ? o_r180 : o_t75)
{}
QString axis_opts::n(QString pfx, QString name)
diff --git a/logic/mappings.cpp b/logic/mappings.cpp
index bae8c2c0..9e81bb01 100644
--- a/logic/mappings.cpp
+++ b/logic/mappings.cpp
@@ -1,5 +1,7 @@
#include "mappings.hpp"
+#include <utility>
+
Map::Map(QString primary, QString secondary, int max_x, int max_y, axis_opts& opts) :
opts(opts),
name1(primary),
@@ -7,8 +9,11 @@ Map::Map(QString primary, QString secondary, int max_x, int max_y, axis_opts& op
spline_main(max_x, max_y, primary),
spline_alt(max_x, max_y, secondary)
{
- spline_main.set_max_input(opts.clamp);
- spline_alt.set_max_input(opts.clamp);
+ 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()
@@ -29,7 +34,7 @@ Mappings::Mappings(std::vector<axis_opts*> opts) :
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, 180, *opts[Pitch]),
+ 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])
}
{}