diff --git a/src/filter.c b/src/filter.c index 206695bb..8e260fdd 100644 --- a/src/filter.c +++ b/src/filter.c @@ -827,7 +827,7 @@ touchpad_accel_profile_linear(struct motion_filter *filter, struct pointer_accelerator *accel_filter = (struct pointer_accelerator *)filter; const double max_accel = accel_filter->accel; /* unitless factor */ - const double threshold = accel_filter->threshold; /* units/us */ + const double threshold = accel_filter->threshold / 2.0; /* units/us */ const double incline = accel_filter->incline; double factor; /* unitless */ @@ -868,31 +868,10 @@ touchpad_accel_profile_linear(struct motion_filter *filter, * 0.3 is chosen simply because it is above the Nyquist frequency for subpixel motion within a pixel. */ - if (speed_in < 7.0) { - factor = 0.1 * speed_in + 0.3; - /* up to the threshold, we keep factor 1, i.e. 1:1 movement */ - } else if (speed_in < threshold) { - factor = 1; - } else { - /* Acceleration function above the threshold: - y = ax' + b - where T is threshold - x is speed_in - x' is speed - and - y(T) == 1 - hence 1 = ax' + 1 - => x' := (x - T) - */ - factor = incline * (speed_in - threshold) + 1; - } - + factor = max(0.4, (1 + 0.5 * filter->speed_adjustment) * (incline * (speed_in - threshold) + 0.4)); /* Cap at the maximum acceleration factor */ factor = min(max_accel, factor); - - /* Scale everything depending on the acceleration set */ - factor *= 1 + 0.5 * filter->speed_adjustment; - + return factor * TP_MAGIC_SLOWDOWN; }