Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing orientation on the devices throws off touch scaling #593

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

Changing orientation on the devices throws off touch scaling #593

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 2.0
Reported for operating system, platform: Android (All), All

Comments on the original bug report:

On 2012-05-25 16:30:29 +0000, Gabriel Jacobo wrote:

The problem is simple enough, if you look at Android_OnTouch it creates a Touch device if none exist, and it scales the touches using Android_ScreenWidth/Android_ScreenHeight.

However, if you turn the device around, these values will of course change, but the scaling remains the same...so the touches are wrongly scaled.

It's an interesting hurdle what to do to solve it.

We can do a hacky thing and for every touch get the touch device pointer (which we already do) and update x_max and y_max blindly...or we can be a more elaborate and only update if x_max != Android_ScreenWidth for example.

I think the best would be to remove all touch devices when the screen size changes, the question is how... (SDL_TouchQuit ?)

On 2012-08-24 09:11:29 +0000, Gabriel Jacobo wrote:

Fixed http://hg.libsdl.org/SDL/rev/2ed5671bc5e0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant