Era-Dorta / gosu-android

A Gosu implementation for Android devices, undergraduate project
MIT License
31 stars 2 forks source link

Touch coordinates are offset in Genymotion #19

Open ashes999 opened 9 years ago

ashes999 commented 9 years ago

Hi,

I seem to have encountered a strange bug. When printing out the coordinates on touch_moved, it seems like (on Genymotion, at least) the coordinates are offset by some pre-determined amount.

When I click/move in an area around the top-left corner of the screen, I get x=0, y = 56.476 (approximately), consistently.

It could be an emulator-specific bug. I don't have a device handy to test on. I know Bluestacks had its own strange bugs in the past.

Era-Dorta commented 9 years ago

Indeed, on my physical device they are offset as well. I suspect they changed the default behaviour at some point. One easy solution would be to add an opposite offset to the touch, to compensate for the window position. The touch event is received here and the class that is used is a GLSurfaceView. Ideally it'll be easier than that, and the GLSurfaceView would have some option to set the coordinate system as absolute or relative to the window position, I haven't actually check. Do you think you that is enough information to fix it?

ashes999 commented 9 years ago

Yes, I think that's enough information. Unfortunately, I have to move on to other projects, and I don't think I will be spending time on this right now. Hopefully, I will revisit these bugs later.