Commit 28835f45 authored by Hans de Goede's avatar Hans de Goede Committed by Dmitry Torokhov

Input: alps - process_bitmap: round down when spreading adjescent fingers over 2 points

This fixes 2 fingers at the same height or width on the touchpad getting
reported at different y / x coordinates.

Note num_bits is always at least 1.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 105affbf
...@@ -391,13 +391,13 @@ static int alps_process_bitmap(struct alps_data *priv, ...@@ -391,13 +391,13 @@ static int alps_process_bitmap(struct alps_data *priv,
* adjacent fingers. Divide the single contact between the two points. * adjacent fingers. Divide the single contact between the two points.
*/ */
if (fingers_x == 1) { if (fingers_x == 1) {
i = x_low.num_bits / 2; i = (x_low.num_bits - 1) / 2;
x_low.num_bits = x_low.num_bits - i; x_low.num_bits = x_low.num_bits - i;
x_high.start_bit = x_low.start_bit + i; x_high.start_bit = x_low.start_bit + i;
x_high.num_bits = max(i, 1); x_high.num_bits = max(i, 1);
} }
if (fingers_y == 1) { if (fingers_y == 1) {
i = y_low.num_bits / 2; i = (y_low.num_bits - 1) / 2;
y_low.num_bits = y_low.num_bits - i; y_low.num_bits = y_low.num_bits - i;
y_high.start_bit = y_low.start_bit + i; y_high.start_bit = y_low.start_bit + i;
y_high.num_bits = max(i, 1); y_high.num_bits = max(i, 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment