From 6faa0650bc59a9d24cd07b90f90f7c9aae30e0bd Mon Sep 17 00:00:00 2001 From: zepumph Date: Mon, 29 Jul 2019 14:23:53 -0800 Subject: [PATCH] create layoutStrategyCenteredInScreen, KeyboardHelpDialog to use it, https://github.com/phetsims/gravity-force-lab/issues/144 --- js/Dialog.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/Dialog.js b/js/Dialog.js index 8d51ee97..2e08b190 100644 --- a/js/Dialog.js +++ b/js/Dialog.js @@ -376,6 +376,12 @@ define( require => { focusCloseButton() { this.closeButton.focus(); } + }, { + + // @public - Center in the screenBounds (doesn't include the navigation bar) + layoutStrategyCenteredInScreen: function( dialog, simBounds, screenBounds, scale ) { + dialog.center = screenBounds.center.times( 1.0 / scale ); + } } );