From 01210b7fba37356ee2c18420762eeeed52489d20 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 29 Jan 2017 03:10:28 +0100 Subject: gui/mapping-window, spline-widget, logic/main-settings: limited mapping range --- logic/main-settings.hpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'logic') diff --git a/logic/main-settings.hpp b/logic/main-settings.hpp index 749f6d25..66146913 100644 --- a/logic/main-settings.hpp +++ b/logic/main-settings.hpp @@ -18,18 +18,30 @@ using namespace options; struct axis_opts final { + enum max_rotation : int + { + r180 = 180, + r90 = 90, + r60 = 60, + r45 = 45, + r30 = 30, + r20 = 25, + }; + // note, these two bundles can be the same value with no issues bundle b_settings_window, b_mapping_window; value zero; value src; value invert, altp; + value clamp; axis_opts(bundle b_settings_window, bundle b_mapping_window, QString pfx, int idx) : b_settings_window(b_settings_window), b_mapping_window(b_mapping_window), zero(b_settings_window, n(pfx, "zero-pos"), 0), 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) + altp(b_mapping_window, n(pfx, "alt-axis-sign"), false), + clamp(b_mapping_window, n(pfx, "max-value"), idx == Pitch ? r90 : r180) {} private: static inline QString n(QString pfx, QString name) -- cgit v1.2.3