mirror of https://github.com/zmkfirmware/zmk.git
fix(behaviors): correctly handle sensor rotation remainder (#3084)
The original condition was always true, this commit fixes the condition to correctly handle the remainder for sensor rotation behaviors by using abs(). Co-authored-by: schuay <schuay@users.noreply.github.com>
This commit is contained in:
parent
3c0f0af947
commit
958fa78806
|
|
@ -34,7 +34,7 @@ int zmk_behavior_sensor_rotate_common_accept_data(
|
|||
remainder.val1 += value.val1;
|
||||
remainder.val2 += value.val2;
|
||||
|
||||
if (remainder.val2 >= 1000000 || remainder.val2 <= 1000000) {
|
||||
if (abs(remainder.val2) >= 1000000) {
|
||||
remainder.val1 += remainder.val2 / 1000000;
|
||||
remainder.val2 %= 1000000;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue