From 0ea498d9ce10120245b5b5a5048c8f28ae9afa9f Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Tue, 3 Jan 2023 22:20:30 +0600 Subject: [PATCH] wacom: Account for negative coordinate overflows --- src/device/mouse_wacom_tablet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/device/mouse_wacom_tablet.c b/src/device/mouse_wacom_tablet.c index 099f9c5c8..8ea807bd7 100644 --- a/src/device/mouse_wacom_tablet.c +++ b/src/device/mouse_wacom_tablet.c @@ -174,6 +174,8 @@ wacom_poll(int x, int y, int z, int b, double abs_x, double abs_y, void *priv) wacom->abs_y = abs_y * (wacom->measurement ? 2972. : 3774.); if (wacom->abs_x > (wacom->measurement ? 4566 : 5800)) wacom->abs_x = (wacom->measurement ? 4566 : 5800); if (wacom->abs_y > (wacom->measurement ? 2972 : 3774)) wacom->abs_x = (wacom->measurement ? 2972 : 3774); + if (wacom->abs_x < 0) wacom->abs_x = 0; + if (wacom->abs_y < 0) wacom->abs_y = 0; wacom->rel_x = x; wacom->rel_y = y; if (wacom->b != b) wacom->oldb = wacom->b;