diff options
| -rw-r--r-- | common/accel-base.hpp | 2 | ||||
| -rw-r--r-- | wrapper/wrapper.cpp | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/common/accel-base.hpp b/common/accel-base.hpp index 5106268..67a1b8f 100644 --- a/common/accel-base.hpp +++ b/common/accel-base.hpp @@ -48,7 +48,7 @@ namespace rawaccel { struct nonadditive_accel : accel_val_base<Func> { nonadditive_accel(const accel_args& args) : accel_val_base(args) { - if (args.weight != 0) weight = args.weight; + if (args.weight > 0) weight = args.weight; } inline double operator()(double speed) const { 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"); |