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

Scene becomes "squished" when changing orientation on iOS Firefox and Safari #3525

Closed
SteveX opened this issue Apr 6, 2018 · 1 comment
Closed

Comments

@SteveX
Copy link
Contributor

SteveX commented Apr 6, 2018

Description:
Viewing the most basic example https://aframe.glitch.me/ on iPhone SE or iPad Pro 12.9" using Firefox and Safari, when you change device orientation the sphere, cylinder and cube can become "squished", so the sphere is ovoid etc.

On the iPhone this happens when the browser is showing the controls, and also when started from a Safari Add to Home icon.

On the iPad 12.9", this doesn't happen when the browser controls are showing, but does when the scene is started from a Safari Add to Home icon.

  • A-Frame Version:0.8.0
  • Platform / Device: Firefox and Safari on iOS / iPhone SE & iPad Pro 12'9"
  • Reproducible Code Snippet or URL: https://aframe.glitch.me/
@RSpace
Copy link
Contributor

RSpace commented Jul 30, 2018

I've investigated this issue. There's some funky bugs making it out into the Mobile Safari releases, like this one:
https://hackernoon.com/onresize-event-broken-in-mobile-safari-d8469027bf4d

However, there's already been a fix added for that (#3282), and so this appears to be something else. Specifically, it has do to with how Mobile Safari returns the width and height of the window. Inspired by the article above and how it's done on apple.com, I found out that this bug goes away if we read the size of the viewport from document.body.offsetWidth and -Height instead of from window.innerWidth and -Height.

I've proposed this fix in this PR:
#3711

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

2 participants