diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-05-19 21:30:48 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-05-19 21:30:48 +0300 |
commit | 38f65c500c1257bfdf586ae6b7b26cc1b77086ed (patch) | |
tree | 54862940844304549f67ea75ba1c90644ef59991 /intern/ghost | |
parent | dedc9950188dc71a3a89d62f3f15d98d0adfc511 (diff) |
Fix T48204: Generic Tablet on Linux - Erratic strokes with pressure sensitivity enabled.
Once and for all - I hope!
So, for the records: Xinput1 events' valuators have a first_axis and axis_count defining the 'range'
of valid axes for that event - but valid data in the valuator's array **always** start at zero
(which means that, if event reports first axis as being axis 2, axis 2's value is in axis_data[0]).
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemX11.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index dde63badb91..95dea38c70a 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -1239,7 +1239,8 @@ GHOST_SystemX11::processEvent(XEvent *xe) * events). So we have to check which values this event actually contains! */ -#define AXIS_VALUE_GET(axis, val) ((axis_first <= axis && axes_end > axis) && ((void)(val = data->axis_data[axis]), true)) +#define AXIS_VALUE_GET(axis, val) \ + ((axis_first <= axis && axes_end > axis) && ((void)(val = data->axis_data[axis - axis_first]), true)) if (AXIS_VALUE_GET(2, axis_value)) { window->GetTabletData()->Pressure = axis_value / ((float)m_xtablet.PressureLevels); |