filter: drop delta-softening
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 4 Jul 2014 02:52:04 +0000 (12:52 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 9 Jul 2014 02:39:50 +0000 (12:39 +1000)
commitf2dfbc0b826db5e451bc25cae44b07e3b9c827f1
tree2775da56b9320bbef9a605d5fe08456be3f5fda5
parente4d50a73a1e963bdcc9ca63dd1a760eb9d777d1f
filter: drop delta-softening

I doubt this does what we think it does. It doesn't soften the delta changes,
rather it introduces bumps in the smooth processing of the changes.

abs(delta) below 1.0 is untouched, and abs(delta) beyond 3 or 4 isn't
noticable much. But in the slow range around the 1/-1 mark there is a bump.

For example, if our last_delta is 1.0 and delta is 1.1, the "softened"
delta is set to 0.6. That is stored as last delta, so an input sequence of:
   0.8, 0.9, 1.0, 1.1, 1.2, 1.0, 0.8, 1.1

results in "softened" deltas that don't match the input:
   0.8, 0.9, 1.0, 0.6, 0.7, 1.0, 0.8, 0.6

A better approach at smoothing this out would be to calculate the softened as:
   current = current ± diff(last, current) * 0.5
or even weighted towards the new delta
   current = current ± diff(last, current) * 0.25

In tests, this makes little difference. Dropping this function altogether is
sufficient to make the pointer pointer behave slightly better at low speeds
though the increase is small enough to attribute to confirmation bias.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
src/filter.c