[Kdrive] make XCalibrate 'orientation aware'

This commit is contained in:
Richard Purdie
2008-01-08 12:12:06 +01:00
committed by Dodji Seketeli
parent 30375cd6d1
commit c31aead0fe
3 changed files with 62 additions and 2 deletions

View File

@@ -631,6 +631,18 @@ KdComputePointerMatrix (KdPointerMatrix *m, Rotation randr, int width,
}
}
void
KdScreenToPointerCoords (int *x, int *y)
{
int (*m)[3] = kdPointerMatrix.matrix;
int div = m[0][1] * m[1][0] - m[1][1] * m[0][0];
int sx = *x;
int sy = *y;
*x = (m[0][1] * sy - m[0][1] * m[1][2] + m[1][1] * m[0][2] - m[1][1] * sx) / div;
*y = (m[1][0] * sx + m[0][0] * m[1][2] - m[1][0] * m[0][2] - m[0][0] * sy) / div;
}
static void
KdKbdCtrl (DeviceIntPtr pDevice, KeybdCtrl *ctrl)
{