diff options
| author | a1xd <[email protected]> | 2020-12-03 22:42:29 -0500 |
|---|---|---|
| committer | a1xd <[email protected]> | 2020-12-03 22:42:29 -0500 |
| commit | c221eb3d62ccbd7f2a5203abd3e0eae8e9bf31e8 (patch) | |
| tree | 10f984c905084eae140d7eb15eb81592f50d537f /common | |
| parent | fix chart range not updating on disable (diff) | |
| download | rawaccel-c221eb3d62ccbd7f2a5203abd3e0eae8e9bf31e8.tar.xz rawaccel-c221eb3d62ccbd7f2a5203abd3e0eae8e9bf31e8.zip | |
add changes from review
rename some vars
prefer exceptions over assert
refactor poll rate field usage in MouseWatcher
Diffstat (limited to 'common')
| -rw-r--r-- | common/rawaccel-settings.h | 2 | ||||
| -rw-r--r-- | common/rawaccel.hpp | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/common/rawaccel-settings.h b/common/rawaccel-settings.h index 0f52807..649c936 100644 --- a/common/rawaccel-settings.h +++ b/common/rawaccel-settings.h @@ -21,7 +21,7 @@ namespace rawaccel { vec2<accel_mode> modes = { accel_mode::noaccel, accel_mode::noaccel }; vec2<accel_args> argsv; vec2d sens = { 1, 1 }; - vec2d neg_multipliers = {}; + vec2d dir_multipliers = {}; milliseconds time_min = DEFAULT_TIME_MIN; }; diff --git a/common/rawaccel.hpp b/common/rawaccel.hpp index a7b9144..3e049cb 100644 --- a/common/rawaccel.hpp +++ b/common/rawaccel.hpp @@ -233,7 +233,7 @@ namespace rawaccel { rotator rotate; vec2<accelerator> accels; vec2d sensitivity = { 1, 1 }; - vec2d negative_multipliers = {}; + vec2d directional_multipliers = {}; mouse_modifier(const settings& args, vec2<si_pair*> luts = {}) : combine_magnitudes(args.combine_mags) @@ -246,8 +246,8 @@ namespace rawaccel { if (args.sens.x != 0) sensitivity.x = args.sens.x; if (args.sens.y != 0) sensitivity.y = args.sens.y; - negative_multipliers.x = fabs(args.neg_multipliers.x); - negative_multipliers.y = fabs(args.neg_multipliers.y); + directional_multipliers.x = fabs(args.dir_multipliers.x); + directional_multipliers.y = fabs(args.dir_multipliers.y); if ((combine_magnitudes && args.modes.x == accel_mode::noaccel) || (args.modes.x == accel_mode::noaccel && @@ -293,11 +293,11 @@ namespace rawaccel { movement.x *= sensitivity.x; movement.y *= sensitivity.y; - if (negative_multipliers.x > 0 && movement.x < 0) { - movement.x *= negative_multipliers.x; + if (directional_multipliers.x > 0 && movement.x < 0) { + movement.x *= directional_multipliers.x; } - if (negative_multipliers.y > 0 && movement.y < 0) { - movement.y *= negative_multipliers.y; + if (directional_multipliers.y > 0 && movement.y < 0) { + movement.y *= directional_multipliers.y; } } |