From 695644fbf2d8293d9d0e043bfac58dff51d1c245 Mon Sep 17 00:00:00 2001 From: Jonathan Olson Date: Mon, 27 Jul 2020 20:19:48 -0600 Subject: [PATCH] Adjusting dialog scaling for https://github.com/phetsims/joist/issues/586 in branch dialog-scaling --- js/AboutDialog.js | 7 +------ js/PhetButton.js | 4 ++-- js/Sim.js | 7 ++++--- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/js/AboutDialog.js b/js/AboutDialog.js index 97c09ebb..361a7b5e 100644 --- a/js/AboutDialog.js +++ b/js/AboutDialog.js @@ -17,11 +17,9 @@ import VBox from '../../scenery/js/nodes/VBox.js'; import VStrut from '../../scenery/js/nodes/VStrut.js'; import Dialog from '../../sun/js/Dialog.js'; import CreditsNode from './CreditsNode.js'; -import HomeScreenView from './HomeScreenView.js'; import joist from './joist.js'; import joistStrings from './joistStrings.js'; import packageJSON from './packageJSON.js'; -import ScreenView from './ScreenView.js'; import updateCheck from './updateCheck.js'; import UpdateNodes from './UpdateNodes.js'; import UpdateState from './UpdateState.js'; @@ -232,10 +230,7 @@ class AboutDialog extends Dialog { tandem: tandem, phetioReadOnly: true, // the AboutDialog should not be settable phetioState: true, - phetioDynamicElement: true, - - //TODO workaround for https://github.com/phetsims/joist/issues/586 and https://github.com/phetsims/joist/issues/639 - scale: HomeScreenView.LAYOUT_BOUNDS.width / ScreenView.DEFAULT_LAYOUT_BOUNDS.width + phetioDynamicElement: true } ); // @private diff --git a/js/PhetButton.js b/js/PhetButton.js index 40747f8f..3f004512 100644 --- a/js/PhetButton.js +++ b/js/PhetButton.js @@ -60,9 +60,9 @@ function PhetButton( sim, backgroundFillProperty, tandem ) { Property.multilink( [ sim.boundsProperty, sim.screenBoundsProperty, sim.scaleProperty ], ( bounds, screenBounds, scale ) => { if ( bounds && screenBounds && scale ) { - phetMenu.right = bounds.right / scale - 2 / scale; + phetMenu.right = bounds.right - 2; const navBarHeight = bounds.height - screenBounds.height; - phetMenu.bottom = screenBounds.bottom / scale + navBarHeight / 2 / scale; + phetMenu.bottom = screenBounds.bottom + navBarHeight / 2; } } ); diff --git a/js/Sim.js b/js/Sim.js index 833ef5a2..4f272eb5 100644 --- a/js/Sim.js +++ b/js/Sim.js @@ -178,9 +178,7 @@ function Sim( name, allSimScreens, options ) { // Layout each of the screens _.each( this.screens, m => m.view.layout( width, screenHeight ) ); - - // Resize the layer with all of the dialogs, etc. - this.topLayer.setScaleMagnitude( scale ); + this.topLayer.children.forEach( child => child.layout && child.layout( width, screenHeight ) ); // Fixes problems where the div would be way off center on iOS7 if ( platform.mobileSafari ) { @@ -764,6 +762,9 @@ inherit( Object, Sim, { if ( isModal ) { this.modalNodeStack.push( node ); } + if ( node.layout ) { + node.layout( this.screenBoundsProperty.value.width, this.screenBoundsProperty.value.height ); + } this.topLayer.addChild( node ); },