summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2014-07-08 12:09:20 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2014-07-09 12:48:44 +1000
commit14ba84cdca6776772e50efd3753ac01080317669 (patch)
treefd56b1099b93848b78e897b23574a4f09564ab72
parentb908e070e9a81e5ab6fa7840ce085a330a2c7eac (diff)
downloadlibinput-14ba84cdca6776772e50efd3753ac01080317669.tar.gz
filter: drop constant acceleration
This just moves a decimal point around, at the expense of making the approach harder to understand. The only time the const acceleration matters is when applied to the velocity but it only matters in relation to the threshold which is a fixed number. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--src/filter.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/filter.c b/src/filter.c
index 4b2bbadd..5b0b8774 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -51,8 +51,7 @@ filter_destroy(struct motion_filter *filter)
* Default parameters for pointer acceleration profiles.
*/
-#define DEFAULT_CONSTANT_ACCELERATION 10.0 /* unitless factor */
-#define DEFAULT_THRESHOLD 4.0 /* in units/ms */
+#define DEFAULT_THRESHOLD 0.4 /* in units/ms */
#define DEFAULT_ACCELERATION 2.0 /* unitless factor */
/*
@@ -337,12 +336,11 @@ pointer_accel_profile_smooth_simple(struct motion_filter *filter,
double smooth_accel_coefficient; /* unitless factor */
double factor; /* unitless factor */
- if (threshold < 1.0)
- threshold = 1.0;
+ if (threshold < 0.1)
+ threshold = 0.1;
if (accel < 1.0)
accel = 1.0;
- velocity *= DEFAULT_CONSTANT_ACCELERATION;
if (velocity < (threshold / 2.0))
return calc_penumbral_gradient(0.5 + velocity / threshold) * 2.0 - 1.0;