summaryrefslogtreecommitdiff
path: root/wrapper/wrapper.cpp
diff options
context:
space:
mode:
authora1xd <[email protected]>2020-09-28 10:02:04 -0400
committera1xd <[email protected]>2020-09-28 10:02:04 -0400
commit0d663cd6729160c610e3c6374f71097f8bb2af8b (patch)
tree92566357b0c0548d842c56287752d238dcdac805 /wrapper/wrapper.cpp
parentupdate build config (diff)
downloadrawaccel-0d663cd6729160c610e3c6374f71097f8bb2af8b.tar.xz
rawaccel-0d663cd6729160c610e3c6374f71097f8bb2af8b.zip
disallow negative weight with non-additive types
Diffstat (limited to 'wrapper/wrapper.cpp')
-rw-r--r--wrapper/wrapper.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/wrapper/wrapper.cpp b/wrapper/wrapper.cpp
index 72ebdc7..3d77fc1 100644
--- a/wrapper/wrapper.cpp
+++ b/wrapper/wrapper.cpp
@@ -137,9 +137,12 @@ error_list_t^ get_accel_errors(AccelMode mode, AccelArgs^ args)
if (args->acceleration > 1 && is_mode(am::natural, am::naturalgain))
error_list->Add("acceleration can not be greater than 1");
- else if (args->acceleration < 0)
- error_list->Add("acceleration can not be negative, use a negative weight to compensate");
-
+ else if (args->acceleration < 0) {
+ bool additive = m < am::power;
+ if (additive) error_list->Add("acceleration can not be negative, use a negative weight to compensate");
+ else error_list->Add("acceleration can not be negative");
+ }
+
if (args->scale <= 0)
error_list->Add("scale must be positive");