From cd915ecc5017ee20c1c5a96c80a4badf332c9c5e Mon Sep 17 00:00:00 2001 From: mzoeller Date: Sat, 28 May 2016 13:58:41 +0200 Subject: [PATCH] Fix wrong aspect ration on OS X Safari This fixes https://github.com/mpetroff/pannellum/issues/155. I'm sure it can be done more elegantly but it should point you in the right direction, basically recalculate aspect ration after full screen was entered and render one frame so that screen does not stay black. --- src/js/pannellum.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/js/pannellum.js b/src/js/pannellum.js index d9be91d..1ef2674 100644 --- a/src/js/pannellum.js +++ b/src/js/pannellum.js @@ -1680,6 +1680,8 @@ function onFullScreenChange() { if (document.fullscreen || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement) { controls.fullscreen.classList.add('pnlm-fullscreen-toggle-button-active'); fullscreenActive = true; + // Fix wrong aspect ration on OS X Safari: https://github.com/mpetroff/pannellum/issues/155 + renderer.resize(); render(); } else { controls.fullscreen.classList.remove('pnlm-fullscreen-toggle-button-active'); fullscreenActive = false;