Skip to content

Commit e8b17bb

Browse files
committed
comment
1 parent f1d1a49 commit e8b17bb

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/kloak.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,11 @@ static int32_t get_ticks_from_scroll_accum(double *accum_ptr) {
10791079
if (fpclassify(scroll_accum) != FP_ZERO) {
10801080
assert(isfinite(scroll_accum));
10811081
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. */
10821087
assert(scroll_ticks_d <= (INT32_MAX / SCROLL_UNITS_PER_TICK));
10831088
assert(scroll_ticks_d >= (INT32_MIN / SCROLL_UNITS_PER_TICK));
10841089
scroll_ticks = (int32_t)(scroll_ticks_d);

0 commit comments

Comments
 (0)