From f20b2c7632cdef1d48e6dab0cf5d57e9c6af7d93 Mon Sep 17 00:00:00 2001 From: Jens Peters Date: Thu, 8 Aug 2024 20:01:37 +0200 Subject: [PATCH] input: apply tablet rotation before area transformation This makes the behavior consistent with auto-rotation as a result of output mapping. --- docs/labwc-config.5.scd | 2 +- src/input/tablet.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/labwc-config.5.scd b/docs/labwc-config.5.scd index c526f8cd..bd03fd6b 100644 --- a/docs/labwc-config.5.scd +++ b/docs/labwc-config.5.scd @@ -696,7 +696,7 @@ extending outward from the snapped edge. ** [0|90|180|270] The tablet orientation can be changed in 90 degree steps. Default is - no rotation (0). Rotation will be applied after applying tablet area + no rotation (0). Rotation will be applied before applying tablet area transformation. See also *calibrationMatrix* in libinput section below for advanced diff --git a/src/input/tablet.c b/src/input/tablet.c index 341d45ac..1d280e71 100644 --- a/src/input/tablet.c +++ b/src/input/tablet.c @@ -125,9 +125,9 @@ tablet_get_coords(struct drawing_tablet *tablet, double *x, double *y, double *d *y = tablet->y; *dx = tablet->dx; *dy = tablet->dy; + adjust_for_rotation(rc.tablet.rotation, x, y); adjust_for_tablet_area(tablet->tablet->width_mm, tablet->tablet->height_mm, rc.tablet.box, x, y); - adjust_for_rotation(rc.tablet.rotation, x, y); adjust_for_rotation_relative(rc.tablet.rotation, dx, dy); adjust_for_motion_sensitivity(rc.tablet_tool.relative_motion_sensitivity, dx, dy);