From 10e28851b8f86ffd0644fe3ee1cd621d42421e1a Mon Sep 17 00:00:00 2001 From: Jonathan Olson Date: Mon, 9 Sep 2019 10:33:54 -0600 Subject: [PATCH] Add visual viewport and orientation change triggers for resize checks, see https://github.com/phetsims/phet-core/issues/64 --- js/Sim.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/Sim.js b/js/Sim.js index 5a2833a8..54c21174 100644 --- a/js/Sim.js +++ b/js/Sim.js @@ -514,6 +514,8 @@ define( function( require ) { // Fit to the window and render the initial scene $( window ).resize( function() { sim.resizeToWindow(); } ); + window.addEventListener( 'orientationchange', function() { sim.resizeToWindow(); } ); + window.visualViewport && window.visualViewport.addEventListener( 'resize', function() { sim.resizeToWindow(); } ); sim.resizeToWindow(); // Kick off checking for updates, if that is enabled