Skip to content

Commit

Permalink
fix touch offest in window mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tito committed Apr 29, 2013
1 parent c1038d1 commit 9eddd5e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/src/org/renpy/android/SDLSurfaceView.java
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,8 @@ public boolean onTouchEvent(final MotionEvent event) {
int sdlAction = -1;
int pointerId = -1;
int pointerIndex = -1;
int[] coords = new int[2];
this.getLocationInWindow(coords);

switch ( action ) {
case MotionEvent.ACTION_DOWN:
Expand Down Expand Up @@ -937,8 +939,8 @@ public boolean onTouchEvent(final MotionEvent event) {
));
**/
SDLSurfaceView.nativeMouse(
(int)event.getX(i),
(int)event.getY(i),
(int)event.getX(i) - coords[0],
(int)event.getY(i) - coords[1],
sdlAction,
event.getPointerId(i),
(int)(event.getPressure(i) * 1000.0),
Expand Down

0 comments on commit 9eddd5e

Please sign in to comment.