summaryrefslogtreecommitdiff
path: root/src/filter-touchpad-flat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/filter-touchpad-flat.c')
-rw-r--r--src/filter-touchpad-flat.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/filter-touchpad-flat.c b/src/filter-touchpad-flat.c
index 658d5b5d..e69e7afa 100644
--- a/src/filter-touchpad-flat.c
+++ b/src/filter-touchpad-flat.c
@@ -49,18 +49,19 @@ accelerator_filter_touchpad_flat(struct motion_filter *filter,
const struct device_float_coords *unaccelerated,
void *data, uint64_t time)
{
- struct touchpad_accelerator_flat *accel_filter =
+ struct touchpad_accelerator_flat *accel =
(struct touchpad_accelerator_flat *)filter;
double factor; /* unitless factor */
- struct normalized_coords accelerated;
+ struct normalized_coords normalized;
/* You want flat acceleration, you get flat acceleration for the
* device */
- factor = accel_filter->factor;
- accelerated.x = TP_MAGIC_SLOWDOWN_FLAT * factor * unaccelerated->x;
- accelerated.y = TP_MAGIC_SLOWDOWN_FLAT * factor * unaccelerated->y;
+ factor = accel->factor;
+ normalized = normalize_for_dpi(unaccelerated, accel->dpi);
+ normalized.x = TP_MAGIC_SLOWDOWN_FLAT * factor * normalized.x;
+ normalized.y = TP_MAGIC_SLOWDOWN_FLAT * factor * normalized.y;
- return accelerated;
+ return normalized;
}
static struct normalized_coords