Skip to content

Commit

Permalink
replace multiple assignment, phetsims/chipper#794
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Sep 26, 2019
1 parent 75a02d1 commit 4f5fa0c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
7 changes: 6 additions & 1 deletion js/common/view/ABSScreenView.js
Expand Up @@ -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 );
} );

Expand Down
3 changes: 2 additions & 1 deletion js/mysolution/MySolutionScreen.js
Expand Up @@ -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' } );

Expand Down
9 changes: 8 additions & 1 deletion js/mysolution/view/SolutionControl.js
Expand Up @@ -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;
Expand Down

0 comments on commit 4f5fa0c

Please sign in to comment.