DS Core: Fix touchscreen wrapping
Vicki Pfau vi@endrift.com
Fri, 07 Apr 2017 15:42:58 -0700
1 files changed,
7 insertions(+),
0 deletions(-)
jump to
M
src/ds/core.c
→
src/ds/core.c
@@ -355,6 +355,13 @@ dscore->cursorX = x;
dscore->cursorY = y - DS_VIDEO_VERTICAL_PIXELS; if (dscore->cursorY < 0) { dscore->cursorY = 0; + } else if (dscore->cursorY >= DS_VIDEO_VERTICAL_PIXELS) { + dscore->cursorY = DS_VIDEO_VERTICAL_PIXELS - 1; + } + if (dscore->cursorX < 0) { + dscore->cursorX = 0; + } else if (dscore->cursorX >= DS_VIDEO_HORIZONTAL_PIXELS) { + dscore->cursorX = DS_VIDEO_HORIZONTAL_PIXELS - 1; } }