evdev-tablet: clip touch arbitration rectangle
authorhrdl <git@hrdl.eu>
Tue, 7 Feb 2023 10:19:35 +0000 (11:19 +0100)
committerhrdl <51402-hrdl@users.noreply.gitlab.freedesktop.org>
Tue, 7 Feb 2023 10:26:27 +0000 (11:26 +0100)
Previously the arbitration rectangle would be moved to lie completely in
the first quadrant of the coordinate system.

Signed-off-by: hrdl <51402-hrdl@users.noreply.gitlab.freedesktop.org>
src/evdev-tablet.c

index 6ce21d0787d353592c74a71e497df395959bf10c..9367d8605786ec340061887ff141e03893fc58f9 100644 (file)
@@ -1506,7 +1506,7 @@ tablet_calculate_arbitration_rect(struct tablet_dispatch *tablet)
         * If the stylus is tilted left (tip further right than the eraser
         * end) assume left-handed mode.
         *
-        * Obviously if we'd run out of the boundaries, we rescale the rect
+        * Obviously if we'd run out of the boundaries, we clip the rect
         * accordingly.
         */
        if (tablet->axes.tilt.x > 0) {
@@ -1519,14 +1519,14 @@ tablet_calculate_arbitration_rect(struct tablet_dispatch *tablet)
        }
 
        if (r.x < 0) {
-               r.w -= r.x;
+               r.w += r.x;
                r.x = 0;
        }
 
        r.y = mm.y - 100;
        r.h = 250;
        if (r.y < 0) {
-               r.h -= r.y;
+               r.h += r.y;
                r.y = 0;
        }