Signed-off-by: Peter Hutterer <[email protected]>
---
src/wcmCommon.c | 15 +++++++++------
src/xf86Wacom.c | 19 ++-----------------
src/xf86WacomDefs.h | 2 --
3 files changed, 11 insertions(+), 25 deletions(-)
diff --git a/src/wcmCommon.c b/src/wcmCommon.c
index 4bf4562..0636169 100644
--- a/src/wcmCommon.c
+++ b/src/wcmCommon.c
@@ -87,15 +87,14 @@ void set_absolute(InputInfoPtr pInfo, Bool absolute)
void wcmMappingFactor(InputInfoPtr pInfo)
{
WacomDevicePtr priv = (WacomDevicePtr) pInfo->private;
+ double size_x, size_y;
DBG(10, priv, "\n"); /* just prints function name */
- wcmVirtualTabletSize(pInfo);
-
DBG(10, priv,
- "Active tablet area x=%d y=%d (virtual tablet area x=%d y=%d)
map"
+ "Active tablet area x=%d y=%d map"
" to maxWidth =%d maxHeight =%d\n",
- priv->bottomX, priv->bottomY, priv->sizeX, priv->sizeY,
+ priv->bottomX, priv->bottomY,
priv->maxWidth, priv->maxHeight);
/* bottomX/bottomY are scaled values of maxX/maxY such that it
@@ -103,8 +102,12 @@ void wcmMappingFactor(InputInfoPtr pInfo)
* Use this to compute similar factor for scaling in relative
* mode. If screen:tablet are 1:1 ratio then no scaling.
*/
- priv->factorX = (double)priv->sizeX / (double)priv->bottomX;
- priv->factorY = (double)priv->sizeY / (double)priv->bottomY;
+
+ size_x = priv->bottomX - priv->topX;
+ size_y = priv->bottomY - priv->topY;
+
+ priv->factorX = size_x / priv->bottomX;
+ priv->factorY = size_y / priv->bottomY;
DBG(2, priv, "X factor = %.3g, Y factor = %.3g\n",
priv->factorX, priv->factorY);
}
diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
index 0df6bde..e8c4710 100644
--- a/src/xf86Wacom.c
+++ b/src/xf86Wacom.c
@@ -202,21 +202,6 @@ void wcmVirtualTabletPadding(InputInfoPtr pInfo)
}
/*****************************************************************************
- * wcmVirtualTabletSize(InputInfoPtr pInfo)
- ****************************************************************************/
-
-void wcmVirtualTabletSize(InputInfoPtr pInfo)
-{
- WacomDevicePtr priv = (WacomDevicePtr)pInfo->private;
-
- priv->sizeX = priv->bottomX - priv->topX;
- priv->sizeY = priv->bottomY - priv->topY;
-
- DBG(10, priv, "x=%d y=%d \n", priv->sizeX, priv->sizeY);
- return;
-}
-
-/*****************************************************************************
* wcmInitialToolSize --
* Initialize logical size and resolution for individual tool.
****************************************************************************/
@@ -274,7 +259,7 @@ wcmInitAxes(DeviceIntPtr pWcm)
/* first valuator: x */
label = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X);
min = priv->topX;
- max = priv->sizeX + priv->topX;
+ max = priv->bottomX;
min_res = 0;
max_res = priv->resolX;
res = priv->resolX;
@@ -293,7 +278,7 @@ wcmInitAxes(DeviceIntPtr pWcm)
/* second valuator: y */
label = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y);
min = priv->topY;
- max = priv->sizeY + priv->topY;
+ max = priv->bottomY;
min_res = 0;
max_res = priv->resolY;
res = priv->resolY;
diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
index 69fc204..186694b 100644
--- a/src/xf86WacomDefs.h
+++ b/src/xf86WacomDefs.h
@@ -224,8 +224,6 @@ struct _WacomDeviceRec
int resolY; /* Y resolution */
int maxX; /* tool physical maxX in device coordinates*/
int maxY; /* tool physical maxY in device coordinates*/
- int sizeX; /* active X size in device coordinates*/
- int sizeY; /* active Y size in device coordinates*/
double factorX; /* X factor */
double factorY; /* Y factor */
unsigned int serial; /* device serial number */
--
1.7.3.4
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel