Skip to content

Instantly share code, notes, and snippets.

@mrdoob
Created September 18, 2014 02:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrdoob/f2ccd368ff773752634e to your computer and use it in GitHub Desktop.
Save mrdoob/f2ccd368ff773752634e to your computer and use it in GitHub Desktop.
Workaround for Safari/iOS8 oversized innerWidth/innerHeight on threejs.org/examples/
if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
viewer.addEventListener( 'load', function ( event ) {
viewer.contentWindow.innerWidth -= 10;
viewer.contentWindow.innerHeight -= 2;
} );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment