From a71d091e594cd359a4fc0d3e868a48c76573a6f4 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 6 Aug 2019 13:09:40 +1000 Subject: tablet: add a comment explaining why we adjust the pressure offset downwards Signed-off-by: Peter Hutterer --- src/evdev-tablet.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c index 27f3f8eb..5c6a3825 100644 --- a/src/evdev-tablet.c +++ b/src/evdev-tablet.c @@ -1271,6 +1271,11 @@ detect_pressure_offset(struct tablet_dispatch *tablet, offset = pressure->value - pressure->minimum; + /* If we have an event that falls below the current offset, adjust + * the offset downwards. A fast contact can start with a + * higher-than-needed pressure offset and then we'd be tied into a + * high pressure offset for the rest of the session. + */ if (tool->has_pressure_offset) { if (offset < tool->pressure_offset) tool->pressure_offset = offset; -- cgit v1.2.1