mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-04 02:20:30 +01:00
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 <peter.hutterer@who-t.net>
This commit is contained in:
parent
4ee1eb3c26
commit
326b2e3261
1 changed files with 8 additions and 0 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue