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

Touch issue after orientation change to landscape on iOS 6 & 7 but not affecting iOS 8 and 9 #1236

Open
logiclove opened this issue Feb 13, 2016 · 2 comments

Comments

@logiclove
Copy link

Touch input is randomly responding or not at all after changing orientation from portrait to LANDSCAPE by rotating the device. Issues has been seen on
iOS 6.1.6 (iPod 4th Gen.)
iOS 7.1.2 (iPhone 4)

Note:
Built using RoboVM Studio 1.13.0 & Xcode 7.2.1.
it works fine in simulator and devices with OS 8.x and 9.x
Setting the treeShaker to none does not remove the issue.

The issue can be reproduced with any sample code using touch. The TouchesGesture example demonstrates the issue. You need to change the MinimumOsVersion" from 8.0 to 7.0 in the Info.plist.xml

Same code used to work on both iOS 6 & 7 when using LibGDX 1.7.2 & RoboVM 1.12

It seems that the X & Y axis are inverted and are not affected by the rotation as they should. The View is rotated but not the input coordinates.

Issue is present in gdxVersion = "1.9.3-SNAPSHOT"
Here is a workaround for the issue by transforming the x,y coordinates received from Gdx.input.setInputProcessor(listener); by applying a transformation similar to the view.

                if (iOS6And7bug_invertInputAxis) {
                    switch (orientationAngle) {
                        case 90: { // rotate left counter clockwise
                            // LandscapeRight
                            int ox = x;
                            int oy = y;
                            x = oy;
                            y = Stage.getHeight() - ox;
                            break;
                        }
                        case 270: { // rotate right clockwise
                            // LandscapeLeft
                            int ox = x;
                            int oy = y;
                            x = Stage.getWidth() - oy;
                            y = ox;
                            break;
                        }
                        case 180: // PortraitUpsideDown
                        case 0: // Portrait
                        default: {
                            break; // no changes
                        }
                    }
               }
@logiclove logiclove changed the title Possible Touch issue after orientation change to landscape on iOS 6 & 7 but not affecting iOS 9.x Possible Touch issue after orientation change to landscape on iOS 6 & 7 but not affecting iOS 8.x and 9.x Feb 14, 2016
@logiclove logiclove changed the title Possible Touch issue after orientation change to landscape on iOS 6 & 7 but not affecting iOS 8.x and 9.x Touch issue after orientation change to landscape on iOS 6 & 7 but not affecting iOS 8.x and 9.x Feb 14, 2016
@logiclove logiclove changed the title Touch issue after orientation change to landscape on iOS 6 & 7 but not affecting iOS 8.x and 9.x Touch issue after orientation change to landscape on iOS 6 & 7 but not affecting iOS 8 and 9 Feb 14, 2016
@coin2
Copy link

coin2 commented Feb 29, 2016

Same problem here. Using ios 6 on an ipod touch. The x and y axes are reversed for touch input. Use to work fine on an older libgdx/robovm.

Worked fine on libgdx 1.7.0 and robovm 1.8.0.

X and Y axes get switched around on libgdx 1.9.2 and robovm 1.12.0.

@badlogic
Copy link
Contributor

It's a bug in libGDX, please check its tracker for progress on this issue.
On Feb 29, 2016 3:48 PM, "coin2" notifications@github.com wrote:

Same problem here. Using ios 6 on an ipod touch. The x and y axes are
reversed for touch input. Use to work fine on an older libgdx/robovm.
Currently using libgdx 1.7.0 and robovm 1.8.0


Reply to this email directly or view it on GitHub
#1236 (comment).

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

3 participants