From b8b16c02df2d86fb3768651a02c1d80192656fff Mon Sep 17 00:00:00 2001 From: zeromus Date: Thu, 22 Jan 2009 05:59:45 +0000 Subject: [PATCH] I think we should throw out touch input when it is out of bounds of the touchscreen, instead of clamping it. what do other people think? --- desmume/src/windows/main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index 2a952f618..85ddac72e 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -1947,9 +1947,12 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM translateXY(x,y); else y-=192; - if(x<0) x = 0; else if(x>255) x = 255; - if(y<0) y = 0; else if(y>192) y = 192; - NDS_setTouchPos(x, y); + //zero 21-01-2009 - if the touch is entirely out of bounds, + //I think we should throw it out instead of clamping it + //if(x<0) x = 0; else if(x>255) x = 255; + //if(y<0) y = 0; else if(y>192) y = 192; + if(x>=0 && x<=255 && y>=0 && y<=192) + NDS_setTouchPos(x, y); return 0; } NDS_releaseTouch();