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?

This commit is contained in:
zeromus 2009-01-22 05:59:45 +00:00
parent c6c4871020
commit b8b16c02df
1 changed files with 6 additions and 3 deletions

View File

@ -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();