Hi,
I use a wacom Intuos3 tablet with artrage, a painting app, on ubuntu karmic with
the latest wine, and I noticed the following.
When in precise tablet mode, artrage will ignore any TopX/Y wacom options. They
are set with xsetwacom to limit the tablet's active area, along with
BottomX/Y . This results to the cursor being in one place, not ignoring these
settings, and the drawing marks appearing in another.
Checking the source, I came upon the funtion ScaleForContext , in
dlls/wintab32/context.c
The values for context InOrgX/Y and InExtX/Y seem to map directly to TopX/Y and
BottomX/Y . However I can't figure out where OutOrgX/Y and OutExtX/Y come
from. They appear to be always 0 for Org, InExt for OutExtX and minus InExt on
the Y axis.
This in mind, the function did not seem right. It seems the InExt values were
meant to be the extent of the active area (right coord - left coord, etc) but
they are the bottom right coordinates instead, equal to wacom BottomY and
BottomX respectively.
When I replaced it with a simple linear interpolation to map a value from
[InOrg , InExt] to [OutOrg , OutExt] ,
Code:
Out = (LONG)(OutOrg + ( ( In - InOrg) * (float)(OutExt - OutOrg)) / (InExt -
InOrg));
along with flipping the Y axis later, everything seems to work ok.
So I have the following questions.
Where do OutOrgX/Y and OutExtX/Y get set for a context? Why is OutExtY always =
to minus InExtY and should it be like that? And finally is the above correct? It
does seem to work for artrage in precise tablet mode (which I'm guessing is
using native tablet coordinates). I'm not a programmer, I just messed around
with the source a bit, I'm not at all sure of what is the proper way of
doing this.