expose option cursor_trail_distance_threshold

This commit is contained in:
Rick Choi
2024-10-27 13:02:35 +09:00
parent 39deb82795
commit f3de97f6d0
6 changed files with 34 additions and 4 deletions

View File

@@ -52,11 +52,10 @@ should_skip_cursor_trail_update(CursorTrail *ct, Window *w, OSWindow *os_window)
return true;
}
int distance_threshold = 2; // make it option
if (distance_threshold > 0 && !ct->needs_render) {
if (OPT(cursor_trail_distance_threshold) > 0 && !ct->needs_render) {
int dx = (int)round((ct->corner_x[0] - EDGE(x, 1)) / WD.dx);
int dy = (int)round((ct->corner_y[0] - EDGE(y, 0)) / WD.dy);
if (abs(dx) + abs(dy) <= distance_threshold) {
if (abs(dx) + abs(dy) <= OPT(cursor_trail_distance_threshold)) {
return true;
}
}