From 4f5fa0c1a2a8ac805df47bc277392f1d80061185 Mon Sep 17 00:00:00 2001 From: Chris Malley Date: Thu, 26 Sep 2019 09:43:42 -0600 Subject: [PATCH] replace multiple assignment, https://github.com/phetsims/chipper/issues/794 --- js/common/view/ABSScreenView.js | 7 ++++++- js/mysolution/MySolutionScreen.js | 3 ++- js/mysolution/view/SolutionControl.js | 9 ++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/js/common/view/ABSScreenView.js b/js/common/view/ABSScreenView.js index 5ed83eb0..0f877fa6 100644 --- a/js/common/view/ABSScreenView.js +++ b/js/common/view/ABSScreenView.js @@ -80,8 +80,13 @@ define( require => { } ); this.viewProperties.toolModeProperty.link( function( toolMode ) { + pHMeterNode.visible = ( toolMode === ToolMode.PH_METER ); - pHPaperNode.visible = pHColorKeyNode.visible = ( toolMode === ToolMode.PH_PAPER ); + + const pHPaperVisible = ( toolMode === ToolMode.PH_PAPER ); + pHPaperNode.visible = pHPaperVisible; + pHColorKeyNode.visible = pHPaperVisible; + conductivityTesterNode.visible = ( toolMode === ToolMode.CONDUCTIVITY ); } ); diff --git a/js/mysolution/MySolutionScreen.js b/js/mysolution/MySolutionScreen.js index 29f5f710..45d749ba 100644 --- a/js/mysolution/MySolutionScreen.js +++ b/js/mysolution/MySolutionScreen.js @@ -65,7 +65,8 @@ define( require => { // position the molecules h3oNode.left = xSpace; ohNode.right = width - xSpace; - h3oNode.centerY = ohNode.centerY = height / 2; + h3oNode.centerY = height / 2; + ohNode.centerY = h3oNode.centerY; const background = new Rectangle( 0, 0, width, height, { fill: 'white' } ); diff --git a/js/mysolution/view/SolutionControl.js b/js/mysolution/view/SolutionControl.js index 15fc20f7..2fc851c4 100644 --- a/js/mysolution/view/SolutionControl.js +++ b/js/mysolution/view/SolutionControl.js @@ -132,8 +132,15 @@ define( require => { const subtitleYSpacing = 6; const separatorYSpacing = 6; const controlYSpacing = 6; + // controls are all center justified - acidBaseSwitch.centerX = concentrationValueControl.centerX = concentrationSlider.centerX = weakStrongSwitch.centerX = strengthSlider.centerX = separatorWidth / 2; + const centerX = separatorWidth / 2; + acidBaseSwitch.centerX = centerX; + concentrationValueControl.centerX = centerX; + concentrationSlider.centerX = centerX; + weakStrongSwitch.centerX = centerX; + strengthSlider.centerX = centerX; + // subtitles are left justified concentrationSeparator.top = acidBaseSwitch.bottom + separatorYSpacing; concentrationTitle.top = concentrationSeparator.bottom + separatorYSpacing;