diff options
author | inmarket <andrewh@inmarket.com.au> | 2013-11-16 01:58:37 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2013-11-16 01:58:37 +1000 |
commit | 3c3bab5d8275a93e12d8b37526811f73a2283195 (patch) | |
tree | 1bcd2a70cdf331cdf6a7473ceb71f321adb5239f /src/ginput | |
parent | a3935c653e2eef4f9cffc86b7fac695f7e7f8987 (diff) | |
download | uGFX-3c3bab5d8275a93e12d8b37526811f73a2283195.tar.gz uGFX-3c3bab5d8275a93e12d8b37526811f73a2283195.tar.bz2 uGFX-3c3bab5d8275a93e12d8b37526811f73a2283195.zip |
Add support for mouse drivers that do their own orientation mapping as the display rotation changes.
Diffstat (limited to 'src/ginput')
-rw-r--r-- | src/ginput/mouse.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/ginput/mouse.c b/src/ginput/mouse.c index 80a4ed20..aa1d2234 100644 --- a/src/ginput/mouse.c +++ b/src/ginput/mouse.c @@ -164,22 +164,22 @@ static struct MouseConfig_t { #endif static void get_calibrated_reading(MouseReading *pt) { - #if GINPUT_MOUSE_NEED_CALIBRATION || GDISP_NEED_CONTROL + #if GINPUT_MOUSE_NEED_CALIBRATION || (GDISP_NEED_CONTROL && !GINPUT_MOUSE_NO_ROTATION) coord_t w, h; #endif get_raw_reading(pt); - #if GINPUT_MOUSE_NEED_CALIBRATION || GDISP_NEED_CONTROL - w = gdispGGetWidth(MouseConfig.display); - h = gdispGGetHeight(MouseConfig.display); - #endif - #if GINPUT_MOUSE_NEED_CALIBRATION _tsTransform(pt, &MouseConfig.caldata); #endif - #if GDISP_NEED_CONTROL + #if GINPUT_MOUSE_NEED_CALIBRATION || (GDISP_NEED_CONTROL && !GINPUT_MOUSE_NO_ROTATION) + w = gdispGGetWidth(MouseConfig.display); + h = gdispGGetHeight(MouseConfig.display); + #endif + + #if GDISP_NEED_CONTROL && !GINPUT_MOUSE_NO_ROTATION switch(gdispGGetOrientation(MouseConfig.display)) { case GDISP_ROTATE_0: break; @@ -207,12 +207,12 @@ static void get_calibrated_reading(MouseReading *pt) { #endif #if GINPUT_MOUSE_NEED_CALIBRATION - if (!(MouseConfig.flags & FLG_CAL_RAW)) { - if (pt->x < 0) pt->x = 0; - else if (pt->x >= w) pt->x = w-1; - if (pt->y < 0) pt->y = 0; - else if (pt->y >= h) pt->y = h-1; - } + if (!(MouseConfig.flags & FLG_CAL_RAW)) { + if (pt->x < 0) pt->x = 0; + else if (pt->x >= w) pt->x = w-1; + if (pt->y < 0) pt->y = 0; + else if (pt->y >= h) pt->y = h-1; + } #endif } |