virtual_pointer: Use saturating math for the v120 value
Browse files at this commit5f2bbe7cb8bf6dbaf9e2f65d5c72dad6f1343645Parent: 21497061 changed file +3 -1
src/protocols/virtual_pointer.rsmodified+3 -1
| @@ -516,7 +516,9 @@ where | |||
| 516 | } | 516 | } |
| 517 | }; | 517 | }; |
| 518 | pointer.mutate_axis_frame(Some(time), |frame| { | 518 | pointer.mutate_axis_frame(Some(time), |frame| { |
| 519 | - frame.value(axis, value).v120(axis, discrete * 120) | 519 | + frame |
| 520 | + .value(axis, value) | ||
| 521 | + .v120(axis, discrete.saturating_mul(120)) | ||
| 520 | }); | 522 | }); |
| 521 | } | 523 | } |
| 522 | zwlr_virtual_pointer_v1::Request::Destroy => {} | 524 | zwlr_virtual_pointer_v1::Request::Destroy => {} |