{"action":"opened","issue":{"url":"https://api.github.com/repos/dimsemenov/PhotoSwipe/issues/1111","repository_url":"https://api.github.com/repos/dimsemenov/PhotoSwipe","labels_url":"https://api.github.com/repos/dimsemenov/PhotoSwipe/issues/1111/labels{/name}","comments_url":"https://api.github.com/repos/dimsemenov/PhotoSwipe/issues/1111/comments","events_url":"https://api.github.com/repos/dimsemenov/PhotoSwipe/issues/1111/events","html_url":"https://github.com/dimsemenov/PhotoSwipe/issues/1111","id":144051157,"number":1111,"title":"Wrong image position under iOS 9.1/9.2","user":{"login":"PointedEars","id":200752,"avatar_url":"https://avatars.githubusercontent.com/u/200752?v=3","gravatar_id":"","url":"https://api.github.com/users/PointedEars","html_url":"https://github.com/PointedEars","followers_url":"https://api.github.com/users/PointedEars/followers","following_url":"https://api.github.com/users/PointedEars/following{/other_user}","gists_url":"https://api.github.com/users/PointedEars/gists{/gist_id}","starred_url":"https://api.github.com/users/PointedEars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PointedEars/subscriptions","organizations_url":"https://api.github.com/users/PointedEars/orgs","repos_url":"https://api.github.com/users/PointedEars/repos","events_url":"https://api.github.com/users/PointedEars/events{/privacy}","received_events_url":"https://api.github.com/users/PointedEars/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-28T18:50:24Z","updated_at":"2016-03-28T18:50:24Z","closed_at":null,"body":"The full-screen image is positioned to the right and the bottom on iOS 9.1 and 9.2:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/200752/14084977/9f142faa-f51d-11e5-8eed-c7d02a167b9f.png)\r\n\r\nWe can reproduce this with PhotoSwipe 4.1.0 and 4.1.1 on iPad 2, iPad Retina, iPad Air, iPad Air 2, iPad Pro under iOS 9.1 (13B143) and 9.2 (13C75) – both in iOS Simulator and on real devices –, but never under iOS 9.3 (13E230).\r\n\r\nMy debugging efforts in PhotoSwipe 4.1.1 so far indicate that it has to do with calculating the “viewport size”:\r\n\r\nIn `src/js/show-hide-transition.js`:62\r\n`  _equalizePoints(_panOffset, item.initialPosition );`\r\n\r\n`item.initialPosition` is occasionally wrong: `{x: 158, y: 497}`, should be `{x: 0, y: …}` where the `y` value should be less than 497.\r\n\r\nI have tracked this down via\r\n\r\n`src/js/items-controller.js`:104\r\n`  item.initialPosition = item.bounds.center;`\r\n\r\n`src/js/items-controller.js`:37\r\n`  bounds.center.x = Math.round((_tempPanAreaSize.x - realPanElementW) / 2);`\r\n\r\n`src/js/items-controller.js`:67\r\n`  _tempPanAreaSize.x = viewportSize.x;`\r\n\r\n`src/js/core.js`:274\r\n`  var bounds = _calculateItemSize( self.currItem, _viewportSize, zoomLevel );`\r\n\r\nto\r\n\r\n`src/js/core.js`:897\r\n`  _viewportSize.x = self.scrollWrap.clientWidth;`\r\n\r\n(CMIIW)\r\n\r\nSince we still need to support iOS 9.2.1 which we presently cannot test, the changelog for that version is sparse to say the least, and the changelog for 9.3 does not appear to contain relevant bugfixes, could you please look into this issue? If you can fix it for iOS 9.2, then it will probably also be fixed for 9.2.1.\r\n\r\nThis issue might be related to #1087 where there appears to be a similar problem under Android."}}