summaryrefslogtreecommitdiff
path: root/common/rawaccel-validate.hpp
diff options
context:
space:
mode:
authora1xd <[email protected]>2021-04-08 02:30:01 -0400
committera1xd <[email protected]>2021-04-08 02:30:01 -0400
commitc55d1bfd01147fa014ac07d4b03ef3cad8427ae6 (patch)
tree39ffa4a79bc6b019443521f10203f787c4b98698 /common/rawaccel-validate.hpp
parentunmark fill as const (diff)
downloadrawaccel-c55d1bfd01147fa014ac07d4b03ef3cad8427ae6.tar.xz
rawaccel-c55d1bfd01147fa014ac07d4b03ef3cad8427ae6.zip
optimize a bit/refactor modify
Diffstat (limited to 'common/rawaccel-validate.hpp')
-rw-r--r--common/rawaccel-validate.hpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/common/rawaccel-validate.hpp b/common/rawaccel-validate.hpp
index 230ddac..4f7dd9c 100644
--- a/common/rawaccel-validate.hpp
+++ b/common/rawaccel-validate.hpp
@@ -141,6 +141,10 @@ namespace rawaccel {
error("max speed is less than min speed");
}
+ if (args.degrees_snap < 0 || args.degrees_snap > 45) {
+ error("snap angle must be between 0 and 45 degrees");
+ }
+
if (args.sens.x == 0 || args.sens.y == 0) {
error("sens multiplier is 0");
}
@@ -150,12 +154,12 @@ namespace rawaccel {
error("domain weights"" must be positive");
}
- if (args.dom_args.lp_norm <= 0) {
- error("Lp norm must be positive");
+ if (args.dir_multipliers.x <= 0 || args.dir_multipliers.y <= 0) {
+ error("directional multipliers must be positive");
}
- if (args.dir_multipliers.x < 0 || args.dir_multipliers.y < 0) {
- error("directional multipliers can not be negative");
+ if (args.dom_args.lp_norm < 2) {
+ error("Lp norm is less than 2 (default=2)");
}
if (args.range_weights.x <= 0 || args.range_weights.y <= 0) {