aboutsummaryrefslogtreecommitdiffstats
path: root/src/ginput
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@seriouslyembedded.com>2015-11-02 12:20:19 +0100
committerJoel Bodenmann <joel@seriouslyembedded.com>2015-11-02 12:20:19 +0100
commit4a860eb07998d8c119b007e5614244d7eaa3eb6a (patch)
tree5f38dce86a7955acfd1214fc3278bef7c5308548 /src/ginput
parent2dcd3509c9313e9de6022dc8a6ba5b91556a1bfa (diff)
downloaduGFX-4a860eb07998d8c119b007e5614244d7eaa3eb6a.tar.gz
uGFX-4a860eb07998d8c119b007e5614244d7eaa3eb6a.tar.bz2
uGFX-4a860eb07998d8c119b007e5614244d7eaa3eb6a.zip
Fixing bug in mouse/touch calibration code
Thanks to AndreR
Diffstat (limited to 'src/ginput')
-rw-r--r--src/ginput/ginput_mouse.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ginput/ginput_mouse.c b/src/ginput/ginput_mouse.c
index 275b9ba4..881d6339 100644
--- a/src/ginput/ginput_mouse.c
+++ b/src/ginput/ginput_mouse.c
@@ -56,8 +56,11 @@ static GTIMER_DECL(MouseTimer);
#include <string.h> // Required for memcpy
static GFXINLINE void CalibrationTransform(GMouseReading *pt, const GMouseCalibration *c) {
- pt->x = (coord_t) (c->ax * pt->x + c->bx * pt->y + c->cx);
- pt->y = (coord_t) (c->ay * pt->x + c->by * pt->y + c->cy);
+ coord_t x = (coord_t) (c->ax * pt->x + c->bx * pt->y + c->cx);
+ coord_t y = (coord_t) (c->ay * pt->x + c->by * pt->y + c->cy);
+
+ pt->x = x;
+ pt->y = y;
}
#endif