We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f1d1a49 commit e8b17bbCopy full SHA for e8b17bb
1 file changed
src/kloak.c
@@ -1079,6 +1079,11 @@ static int32_t get_ticks_from_scroll_accum(double *accum_ptr) {
1079
if (fpclassify(scroll_accum) != FP_ZERO) {
1080
assert(isfinite(scroll_accum));
1081
scroll_ticks_d = scroll_accum / SCROLL_UNITS_PER_TICK_D;
1082
+ /* We intentionally use SCROLL_UNITS_PER_TICK here, not
1083
+ * SCROLL_UNITS_PER_TICK_D. The extra fraction of a scroll tick we would
1084
+ * gain from using SCROLL_UNITS_PER_TICK_D is not worthwhile, and having
1085
+ * the enforced threshold slightly lower than the real threshold is
1086
+ * arguably safer. */
1087
assert(scroll_ticks_d <= (INT32_MAX / SCROLL_UNITS_PER_TICK));
1088
assert(scroll_ticks_d >= (INT32_MIN / SCROLL_UNITS_PER_TICK));
1089
scroll_ticks = (int32_t)(scroll_ticks_d);
0 commit comments