Commit 326b2e32 authored by Cuchaz's avatar Cuchaz Committed by Peter Hutterer
Browse files

tablet: clear tablet history on tool contact change

On some ELAN tablets we get a coordinate jump in the same frame that we put
the tip down. The existing axis smoothing causes that jump to be somewhere in
the middle between the previous and the next coordinates, causing a small
stroke from the smoothed position to the next. Prevent this by resetting the
history on tip down/up so we always take that coordinate.

Fixes #94

Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 4ee1eb3c
Pipeline #2669 failed with stages
in 2 minutes and 6 seconds
......@@ -657,6 +657,14 @@ tablet_check_notify_axes(struct tablet_dispatch *tablet,
rc = true;
out:
/* The tool position often jumps to a different spot when contact changes.
* If tool contact changes, clear the history to prevent axis smoothing
* from trying to average over the spatial discontinuity. */
if (tablet_has_status(tablet, TABLET_TOOL_ENTERING_CONTACT) ||
tablet_has_status(tablet, TABLET_TOOL_LEAVING_CONTACT)) {
tablet_history_reset(tablet);
}
tablet_history_push(tablet, &tablet->axes);
tablet_smoothen_axes(tablet, &axes);
......
Supports Markdown
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