From 58caf372d8baa34a4ee5565df25d34355fc02ea8 Mon Sep 17 00:00:00 2001 From: pixelzoom Date: Tue, 7 Jan 2020 16:05:45 -0700 Subject: [PATCH] rename location to position, https://github.com/phetsims/phet-info/issues/126 --- js/common/model/Beaker.js | 12 +++++------ js/common/model/Dropper.js | 6 +++--- js/common/model/Faucet.js | 6 +++--- js/common/model/Movable.js | 8 ++++---- js/common/view/BeakerNode.js | 2 +- js/common/view/DrainFaucetNode.js | 4 ++-- js/common/view/DropperFluidNode.js | 14 ++++++------- js/common/view/FaucetFluidNode.js | 6 +++--- js/common/view/PHDropperNode.js | 8 ++++---- js/common/view/SolutionNode.js | 4 ++-- js/common/view/VolumeIndicatorNode.js | 8 +++++--- js/common/view/WaterFaucetNode.js | 4 ++-- js/common/view/graph/GraphIndicator.js | 24 +++++++++++----------- js/macro/model/MacroModel.js | 12 +++++------ js/macro/model/PHMeter.js | 10 ++++----- js/macro/view/MacroPHMeterNode.js | 18 ++++++++-------- js/macro/view/MacroScreenView.js | 4 ++-- js/micro/model/MicroModel.js | 2 +- js/micro/view/MicroScreenView.js | 11 ++++++---- js/mysolution/view/MySolutionScreenView.js | 9 +++++--- 20 files changed, 90 insertions(+), 82 deletions(-) diff --git a/js/common/model/Beaker.js b/js/common/model/Beaker.js index 75aa0488..ee78bd25 100644 --- a/js/common/model/Beaker.js +++ b/js/common/model/Beaker.js @@ -16,26 +16,26 @@ define( require => { /** * Constructor - * @param {Vector2} location bottom center + * @param {Vector2} position bottom center * @param {Dimension2} size * @param {Object} [options] * @constructor */ - function Beaker( location, size, options ) { + function Beaker( position, size, options ) { options = merge( { volume: 1.2 // L }, options ); // @Public - this.location = location; + this.position = position; this.size = size; this.volume = options.volume; // @public convenience properties - this.left = location.x - ( size.width / 2 ); - this.right = location.x + ( size.width / 2 ); - this.bounds = new Bounds2( this.left, location.y - size.height, this.right, location.y ); + this.left = position.x - ( size.width / 2 ); + this.right = position.x + ( size.width / 2 ); + this.bounds = new Bounds2( this.left, position.y - size.height, this.right, position.y ); } phScale.register( 'Beaker', Beaker ); diff --git a/js/common/model/Dropper.js b/js/common/model/Dropper.js index 082eb031..921bd6f5 100644 --- a/js/common/model/Dropper.js +++ b/js/common/model/Dropper.js @@ -19,12 +19,12 @@ define( require => { /** * @param {Solute} solute - * @param {Vector2} location + * @param {Vector2} position * @param {Bounds2} dragBounds * @param {Object} [options] * @constructor */ - function Dropper( solute, location, dragBounds, options ) { + function Dropper( solute, position, dragBounds, options ) { options = merge( { maxFlowRate: 0.05, // L/sec @@ -36,7 +36,7 @@ define( require => { }, options ); const self = this; - Movable.call( this, location, dragBounds ); + Movable.call( this, position, dragBounds ); // @public this.soluteProperty = new Property( solute ); diff --git a/js/common/model/Faucet.js b/js/common/model/Faucet.js index 511065d0..bdd4617d 100644 --- a/js/common/model/Faucet.js +++ b/js/common/model/Faucet.js @@ -17,12 +17,12 @@ define( require => { const phScale = require( 'PH_SCALE/phScale' ); /** - * @param {Vector2} location center of output pipe + * @param {Vector2} position center of output pipe * @param {number} pipeMinX x-coordinate of where the pipe starts * @param {Object} [options] * @constructor */ - function Faucet( location, pipeMinX, options ) { + function Faucet( position, pipeMinX, options ) { options = merge( { spoutWidth: 45, // pixels @@ -32,7 +32,7 @@ define( require => { }, options ); // @public - this.location = location; + this.position = position; this.pipeMinX = pipeMinX; this.spoutWidth = options.spoutWidth; this.maxFlowRate = options.maxFlowRate; diff --git a/js/common/model/Movable.js b/js/common/model/Movable.js index 5fdf1819..4d2b6ce9 100644 --- a/js/common/model/Movable.js +++ b/js/common/model/Movable.js @@ -15,14 +15,14 @@ define( require => { const Property = require( 'AXON/Property' ); /** - * @param {Vector2} location + * @param {Vector2} position * @param {Bounds2} dragBounds optional, undefined if not provided * @constructor */ - function Movable( location, dragBounds ) { + function Movable( position, dragBounds ) { // @public - this.locationProperty = new Property( location ); + this.positionProperty = new Property( position ); this.dragBounds = dragBounds; } @@ -32,7 +32,7 @@ define( require => { // @public reset: function() { - this.locationProperty.reset(); + this.positionProperty.reset(); } } ); } ); diff --git a/js/common/view/BeakerNode.js b/js/common/view/BeakerNode.js index 52b28e94..578a7846 100644 --- a/js/common/view/BeakerNode.js +++ b/js/common/view/BeakerNode.js @@ -100,7 +100,7 @@ define( require => { } } - this.translation = modelViewTransform.modelToViewPosition( beaker.location ); + this.translation = modelViewTransform.modelToViewPosition( beaker.position ); } phScale.register( 'BeakerNode', BeakerNode ); diff --git a/js/common/view/DrainFaucetNode.js b/js/common/view/DrainFaucetNode.js index 376c820b..7fe22669 100644 --- a/js/common/view/DrainFaucetNode.js +++ b/js/common/view/DrainFaucetNode.js @@ -23,7 +23,7 @@ define( require => { const scale = 0.6; - const horizontalPipeLength = Math.abs( modelViewTransform.modelToViewX( faucet.location.x - faucet.pipeMinX ) ) / scale; + const horizontalPipeLength = Math.abs( modelViewTransform.modelToViewX( faucet.position.x - faucet.pipeMinX ) ) / scale; FaucetNode.call( this, faucet.maxFlowRate, faucet.flowRateProperty, faucet.enabledProperty, { horizontalPipeLength: horizontalPipeLength, verticalPipeLength: 5, @@ -34,7 +34,7 @@ define( require => { touchAreaYDilation: 60 } } ); - this.translation = modelViewTransform.modelToViewPosition( faucet.location ); + this.translation = modelViewTransform.modelToViewPosition( faucet.position ); this.setScaleMagnitude( -scale, scale ); // reflect horizontally } diff --git a/js/common/view/DropperFluidNode.js b/js/common/view/DropperFluidNode.js index 755845f4..a31e6899 100644 --- a/js/common/view/DropperFluidNode.js +++ b/js/common/view/DropperFluidNode.js @@ -25,20 +25,20 @@ define( require => { const self = this; Rectangle.call( this, 0, 0, 0, 0, { lineWidth: 1 } ); - // shape and location - const updateShapeAndLocation = function() { + // shape and position + const updateShapeAndPosition = function() { // path if ( dropper.flowRateProperty.get() > 0 ) { - self.setRect( -tipWidth / 2, 0, tipWidth, beaker.location.y - dropper.locationProperty.get().y ); + self.setRect( -tipWidth / 2, 0, tipWidth, beaker.position.y - dropper.positionProperty.get().y ); } else { self.setRect( 0, 0, 0, 0 ); } - // move this node to the dropper's location - self.translation = modelViewTransform.modelToViewPosition( dropper.locationProperty.get() ); + // move this node to the dropper's position + self.translation = modelViewTransform.modelToViewPosition( dropper.positionProperty.get() ); }; - dropper.locationProperty.link( updateShapeAndLocation ); - dropper.flowRateProperty.link( updateShapeAndLocation ); + dropper.positionProperty.link( updateShapeAndPosition ); + dropper.flowRateProperty.link( updateShapeAndPosition ); // set color to match solute dropper.soluteProperty.link( function( solute ) { diff --git a/js/common/view/FaucetFluidNode.js b/js/common/view/FaucetFluidNode.js index a040bd1c..c0690d5b 100644 --- a/js/common/view/FaucetFluidNode.js +++ b/js/common/view/FaucetFluidNode.js @@ -36,15 +36,15 @@ define( require => { * Set the width of the shape to match the flow rate. * @param {number} flowRate */ - const viewLocation = modelViewTransform.modelToViewPosition( faucet.location ); + const viewPosition = modelViewTransform.modelToViewPosition( faucet.position ); const viewHeight = modelViewTransform.modelToViewDeltaY( height ); faucet.flowRateProperty.link( function( flowRate ) { if ( flowRate === 0 ) { - self.setRect( -1, -1, 0, 0 ); // empty rectangle, at a location where we won't intersect with it + self.setRect( -1, -1, 0, 0 ); // empty rectangle, at a position where we won't intersect with it } else { const viewWidth = modelViewTransform.modelToViewDeltaX( faucet.spoutWidth * flowRate / faucet.maxFlowRate ); - self.setRect( viewLocation.x - (viewWidth / 2), viewLocation.y, viewWidth, viewHeight ); + self.setRect( viewPosition.x - (viewWidth / 2), viewPosition.y, viewWidth, viewHeight ); } } ); } diff --git a/js/common/view/PHDropperNode.js b/js/common/view/PHDropperNode.js index 782e0ada..58fdd66e 100644 --- a/js/common/view/PHDropperNode.js +++ b/js/common/view/PHDropperNode.js @@ -33,9 +33,9 @@ define( require => { emptyProperty: dropper.emptyProperty }, options ) ); - // location - dropper.locationProperty.link( function( location ) { - self.translation = modelViewTransform.modelToViewPosition( location ); + // position + dropper.positionProperty.link( function( position ) { + self.translation = modelViewTransform.modelToViewPosition( position ); } ); // visibility @@ -53,7 +53,7 @@ define( require => { this.touchArea = this.localBounds.dilatedX( 0.25 * this.width ); // move the dropper - this.addInputListener( new MovableDragHandler( dropper.locationProperty, { + this.addInputListener( new MovableDragHandler( dropper.positionProperty, { dragBounds: dropper.dragBounds, modelViewTransform: modelViewTransform } ) ); diff --git a/js/common/view/SolutionNode.js b/js/common/view/SolutionNode.js index 9307cc90..034e3d90 100644 --- a/js/common/view/SolutionNode.js +++ b/js/common/view/SolutionNode.js @@ -41,7 +41,7 @@ define( require => { * Updates the amount of stuff in the beaker, based on solution volume. * @param {number} volume */ - const viewLocation = modelViewTransform.modelToViewPosition( beaker.location ); + const viewPosition = modelViewTransform.modelToViewPosition( beaker.position ); const viewWidth = modelViewTransform.modelToViewDeltaX( beaker.size.width ); solution.volumeProperty.link( function( volume ) { assert && assert( volume >= 0 ); @@ -58,7 +58,7 @@ define( require => { const viewHeight = modelViewTransform.modelToViewDeltaY( solutionHeight ); // shape - self.setRect( viewLocation.x - (viewWidth / 2), viewLocation.y - viewHeight, viewWidth, viewHeight ); + self.setRect( viewPosition.x - (viewWidth / 2), viewPosition.y - viewHeight, viewWidth, viewHeight ); } ); } diff --git a/js/common/view/VolumeIndicatorNode.js b/js/common/view/VolumeIndicatorNode.js index f1095307..7d6f8e08 100644 --- a/js/common/view/VolumeIndicatorNode.js +++ b/js/common/view/VolumeIndicatorNode.js @@ -57,18 +57,20 @@ define( require => { this.addChild( valueNode ); this.addChild( arrowHead ); - // x location + // x position this.left = modelViewTransform.modelToViewX( beaker.right ) + 3; // update when the volume changes const self = this; volumeProperty.link( function( volume ) { + // text valueNode.text = StringUtils.format( pattern0Value1UnitsString, Utils.toFixed( volume, PHScaleConstants.VOLUME_DECIMAL_PLACES ), unitsLitersString ); valueNode.centerY = arrowHead.centerY; - // y-location + + // y position const solutionHeight = Utils.linear( 0, beaker.volume, 0, beaker.size.height, volume ); // volume -> height, model coordinates - self.y = modelViewTransform.modelToViewY( beaker.location.y - solutionHeight ); + self.y = modelViewTransform.modelToViewY( beaker.position.y - solutionHeight ); } ); } diff --git a/js/common/view/WaterFaucetNode.js b/js/common/view/WaterFaucetNode.js index 38806578..3a08dd3d 100644 --- a/js/common/view/WaterFaucetNode.js +++ b/js/common/view/WaterFaucetNode.js @@ -29,7 +29,7 @@ define( require => { const scale = 0.6; - const horizontalPipeLength = Math.abs( modelViewTransform.modelToViewX( faucet.location.x - faucet.pipeMinX ) ) / scale; + const horizontalPipeLength = Math.abs( modelViewTransform.modelToViewX( faucet.position.x - faucet.pipeMinX ) ) / scale; const faucetNode = new FaucetNode( faucet.maxFlowRate, faucet.flowRateProperty, faucet.enabledProperty, { horizontalPipeLength: horizontalPipeLength, verticalPipeLength: 20, @@ -40,7 +40,7 @@ define( require => { touchAreaYDilation: 60 } } ); - faucetNode.translation = modelViewTransform.modelToViewPosition( faucet.location ); + faucetNode.translation = modelViewTransform.modelToViewPosition( faucet.position ); faucetNode.setScaleMagnitude( -scale, scale ); // reflect horizontally this.addChild( faucetNode ); diff --git a/js/common/view/graph/GraphIndicator.js b/js/common/view/graph/GraphIndicator.js index 601878bd..adb80edd 100644 --- a/js/common/view/graph/GraphIndicator.js +++ b/js/common/view/graph/GraphIndicator.js @@ -2,7 +2,7 @@ /** * The indicator that points to a value on a graph's vertical scale. - * Origin is at the indicator's pointer, and the pointer can be attached to any corner of the indicator (see options.pointerLocation). + * Origin is at the indicator's pointer, and the pointer can be attached to any corner of the indicator (see options.pointerPosition). * Interactive indicators are decorated with a double-headed arrow, indicating the direction of dragging. * * @author Chris Malley (PixelZoom, Inc.) @@ -44,7 +44,7 @@ define( require => { options = merge( { scale: 0.75, // specified by design team - pointerLocation: 'topRight', // values: topLeft, topRight, bottomLeft, bottomRight + pointerPosition: 'topRight', // values: topLeft, topRight, bottomLeft, bottomRight backgroundFill: 'white', backgroundWidth: 160, backgroundHeight: 80, @@ -68,20 +68,20 @@ define( require => { // Transform shapes to support various orientations of pointer. let shapeMatrix; - if ( options.pointerLocation === 'topRight' ) { + if ( options.pointerPosition === 'topRight' ) { shapeMatrix = Matrix3.identity(); // background shape will be drawn with pointer at top-right } - else if ( options.pointerLocation === 'topLeft' ) { + else if ( options.pointerPosition === 'topLeft' ) { shapeMatrix = Matrix3.scaling( -1, 1 ); } - else if ( options.pointerLocation === 'bottomRight' ) { + else if ( options.pointerPosition === 'bottomRight' ) { shapeMatrix = Matrix3.scaling( 1, -1 ); } - else if ( options.pointerLocation === 'bottomLeft' ) { + else if ( options.pointerPosition === 'bottomLeft' ) { shapeMatrix = Matrix3.scaling( -1, -1 ); } else { - throw new Error( 'unsupported options.pointerLocation: ' + options.pointerLocation ); + throw new Error( 'unsupported options.pointerPosition: ' + options.pointerPosition ); } // Background with the pointer at top-right. Proceed clockwise from the tip of the pointer. @@ -134,7 +134,7 @@ define( require => { this.addChild( moleculeAndFormula ); // layout, relative to backgroundNode - if ( options.pointerLocation === 'topRight' || options.pointerLocation === 'bottomRight' ) { + if ( options.pointerPosition === 'topRight' || options.pointerPosition === 'bottomRight' ) { valueBackgroundNode.left = backgroundNode.left + options.backgroundXMargin; } else { @@ -160,7 +160,7 @@ define( require => { this.addChild( arrowNode ); // put the arrow on opposite side of the indicator's pointer - if ( options.pointerLocation === 'topRight' || options.pointerLocation === 'bottomRight' ) { + if ( options.pointerPosition === 'topRight' || options.pointerPosition === 'bottomRight' ) { arrowNode.right = backgroundNode.left - options.arrowXSpacing; } else { @@ -216,7 +216,7 @@ define( require => { new RichText( PHScaleConstants.H3O_FORMULA, { font: new PhetFont( 28 ), fill: 'white' } ), merge( { backgroundFill: PHScaleColors.ACIDIC, - pointerLocation: 'topRight' + pointerPosition: 'topRight' }, options ) ); }, @@ -233,7 +233,7 @@ define( require => { new RichText( PHScaleConstants.OH_FORMULA, { font: new PhetFont( 28 ), fill: 'white', supXSpacing: 2 } ), merge( { backgroundFill: PHScaleColors.BASIC, - pointerLocation: 'topLeft' + pointerPosition: 'topLeft' }, options ) ); }, @@ -250,7 +250,7 @@ define( require => { new RichText( PHScaleConstants.H2O_FORMULA, { font: new PhetFont( 28 ), fill: 'white' } ), merge( { backgroundFill: PHScaleColors.H2O_BACKGROUND, - pointerLocation: 'bottomLeft', + pointerPosition: 'bottomLeft', mantissaDecimalPlaces: 0, exponent: 0 }, options ) ); diff --git a/js/macro/model/MacroModel.js b/js/macro/model/MacroModel.js index c938d459..b7c492a5 100644 --- a/js/macro/model/MacroModel.js +++ b/js/macro/model/MacroModel.js @@ -56,27 +56,27 @@ define( require => { this.beaker = new Beaker( new Vector2( 750, 580 ), new Dimension2( 450, 300 ) ); // Dropper above the beaker - const yDropper = this.beaker.location.y - this.beaker.size.height - 15; + const yDropper = this.beaker.position.y - this.beaker.size.height - 15; // @public this.dropper = new Dropper( Solute.WATER, - new Vector2( this.beaker.location.x - 50, yDropper ), + new Vector2( this.beaker.position.x - 50, yDropper ), new Bounds2( this.beaker.left + 40, yDropper, this.beaker.right - 200, yDropper ) ); // @public Solution in the beaker this.solution = new Solution( this.dropper.soluteProperty, 0, 0, this.beaker.volume ); // @public Water faucet at the beaker's top-right - this.waterFaucet = new Faucet( new Vector2( this.beaker.right - 50, this.beaker.location.y - this.beaker.size.height - 45 ), + this.waterFaucet = new Faucet( new Vector2( this.beaker.right - 50, this.beaker.position.y - this.beaker.size.height - 45 ), this.beaker.right + 400, { enabled: this.solution.volumeProperty.get() < this.beaker.volume } ); // @public Drain faucet at the beaker's bottom-left. - this.drainFaucet = new Faucet( new Vector2( this.beaker.left - 75, this.beaker.location.y + 43 ), this.beaker.left, + this.drainFaucet = new Faucet( new Vector2( this.beaker.left - 75, this.beaker.position.y + 43 ), this.beaker.left, { enabled: this.solution.volumeProperty.get() > 0 } ); // pH meter to the left of the drain faucet - const pHMeterLocation = new Vector2( this.drainFaucet.location.x - 300, 75 ); - this.pHMeter = new PHMeter( pHMeterLocation, new Vector2( pHMeterLocation.x + 150, this.beaker.location.y ), + const pHMeterPosition = new Vector2( this.drainFaucet.position.x - 300, 75 ); + this.pHMeter = new PHMeter( pHMeterPosition, new Vector2( pHMeterPosition.x + 150, this.beaker.position.y ), PHScaleConstants.SCREEN_VIEW_OPTIONS.layoutBounds ); // auto-fill when the solute changes diff --git a/js/macro/model/PHMeter.js b/js/macro/model/PHMeter.js index 2d08c7a1..a2a5fbe0 100644 --- a/js/macro/model/PHMeter.js +++ b/js/macro/model/PHMeter.js @@ -20,15 +20,15 @@ define( require => { const Property = require( 'AXON/Property' ); /** - * @param {Vector2} bodyLocation - * @param {Vector2} probeLocation + * @param {Vector2} bodyPosition + * @param {Vector2} probePosition * @param {Bounds2} probeDragBounds * @constructor */ - function PHMeter( bodyLocation, probeLocation, probeDragBounds ) { + function PHMeter( bodyPosition, probePosition, probeDragBounds ) { this.valueProperty = new Property( null ); // @public null if the meter is not reading a value - this.bodyLocation = bodyLocation; // @public - this.probe = new Movable( probeLocation, probeDragBounds ); // @public + this.bodyPosition = bodyPosition; // @public + this.probe = new Movable( probePosition, probeDragBounds ); // @public } phScale.register( 'PHMeter', PHMeter ); diff --git a/js/macro/view/MacroPHMeterNode.js b/js/macro/view/MacroPHMeterNode.js index bab1a808..4347e3a8 100644 --- a/js/macro/view/MacroPHMeterNode.js +++ b/js/macro/view/MacroPHMeterNode.js @@ -71,9 +71,9 @@ define( require => { Node.call( this ); - // pH scale, positioned at meter 'body' location + // pH scale, positioned at meter 'body' position const scaleNode = new ScaleNode( { size: SCALE_SIZE } ); - scaleNode.translation = modelViewTransform.modelToViewPosition( meter.bodyLocation ); + scaleNode.translation = modelViewTransform.modelToViewPosition( meter.bodyPosition ); // indicator that slides vertically along scale const indicatorNode = new IndicatorNode( meter.valueProperty, SCALE_SIZE.width ); @@ -109,7 +109,7 @@ define( require => { } meter.valueProperty.set( value ); }; - meter.probe.locationProperty.link( updateValue ); + meter.probe.positionProperty.link( updateValue ); solution.soluteProperty.link( updateValue ); solution.pHProperty.link( updateValue ); solutionNode.on( 'bounds', updateValue ); @@ -321,22 +321,22 @@ define( require => { cursor: 'pointer' } ); - // probe location - probe.locationProperty.link( function( location ) { - self.translation = modelViewTransform.modelToViewPosition( location ); + // probe position + probe.positionProperty.link( function( position ) { + self.translation = modelViewTransform.modelToViewPosition( position ); } ); // touch area this.touchArea = this.localBounds.dilated( 20, 20 ); // drag handler - this.addInputListener( new MovableDragHandler( probe.locationProperty, { + this.addInputListener( new MovableDragHandler( probe.positionProperty, { dragBounds: probe.dragBounds, modelViewTransform: modelViewTransform } ) ); const isInNode = function( node ) { - return node.getBounds().containsPoint( probe.locationProperty.get() ); + return node.getBounds().containsPoint( probe.positionProperty.get() ); }; this.isInSolution = function() { @@ -395,7 +395,7 @@ define( require => { .moveTo( bodyConnectionPoint.x, bodyConnectionPoint.y ) .cubicCurveTo( c1.x, c1.y, c2.x, c2.y, probeConnectionPoint.x, probeConnectionPoint.y ); }; - probe.locationProperty.link( updateCurve ); + probe.positionProperty.link( updateCurve ); } inherit( Path, WireNode ); diff --git a/js/macro/view/MacroScreenView.js b/js/macro/view/MacroScreenView.js index 47fa579b..a671eeb3 100644 --- a/js/macro/view/MacroScreenView.js +++ b/js/macro/view/MacroScreenView.js @@ -56,7 +56,7 @@ define( require => { // faucets const waterFaucetNode = new WaterFaucetNode( model.waterFaucet, modelViewTransform ); const drainFaucetNode = new DrainFaucetNode( model.drainFaucet, modelViewTransform ); - const WATER_FLUID_HEIGHT = model.beaker.location.y - model.waterFaucet.location.y; + const WATER_FLUID_HEIGHT = model.beaker.position.y - model.waterFaucet.position.y; const DRAIN_FLUID_HEIGHT = 1000; // tall enough that resizing the play area is unlikely to show bottom of fluid const waterFluidNode = new FaucetFluidNode( model.waterFaucet, new Property( Water.color ), WATER_FLUID_HEIGHT, modelViewTransform ); const drainFluidNode = new FaucetFluidNode( model.drainFaucet, model.solution.colorProperty, DRAIN_FLUID_HEIGHT, modelViewTransform ); @@ -98,7 +98,7 @@ define( require => { } ); this.addChild( rootNode ); - // Layout of nodes that don't have a location specified in the model + // Layout of nodes that don't have a position specified in the model soluteComboBox.left = modelViewTransform.modelToViewX( model.beaker.left ) - 20; // anchor on left so it grows to the right during i18n soluteComboBox.top = this.layoutBounds.top + 15; neutralIndicator.centerX = beakerNode.centerX; diff --git a/js/micro/model/MicroModel.js b/js/micro/model/MicroModel.js index 8cc53599..eec8e307 100644 --- a/js/micro/model/MicroModel.js +++ b/js/micro/model/MicroModel.js @@ -24,7 +24,7 @@ define( require => { MacroModel.call( this ); // adjust the drag bounds of the dropper to account for different user-interface constraints - const yDropper = this.dropper.locationProperty.get().y; + const yDropper = this.dropper.positionProperty.get().y; this.dropper.dragBounds = new Bounds2( this.beaker.left + 120, yDropper, this.beaker.right - 170, yDropper ); } diff --git a/js/micro/view/MicroScreenView.js b/js/micro/view/MicroScreenView.js index 88f30ee3..d1a99c6b 100644 --- a/js/micro/view/MicroScreenView.js +++ b/js/micro/view/MicroScreenView.js @@ -66,7 +66,7 @@ define( require => { // faucets const waterFaucetNode = new WaterFaucetNode( model.waterFaucet, modelViewTransform ); const drainFaucetNode = new DrainFaucetNode( model.drainFaucet, modelViewTransform ); - const SOLVENT_FLUID_HEIGHT = model.beaker.location.y - model.waterFaucet.location.y; + const SOLVENT_FLUID_HEIGHT = model.beaker.position.y - model.waterFaucet.position.y; const DRAIN_FLUID_HEIGHT = 1000; // tall enough that resizing the play area is unlikely to show bottom of fluid const waterFluidNode = new FaucetFluidNode( model.waterFaucet, new Property( Water.color ), SOLVENT_FLUID_HEIGHT, modelViewTransform ); const drainFluidNode = new FaucetFluidNode( model.drainFaucet, model.solution.colorProperty, DRAIN_FLUID_HEIGHT, modelViewTransform ); @@ -92,8 +92,11 @@ define( require => { // pH meter const pHMeterTop = 15; - const pHMeterNode = new PHMeterNode( model.solution, modelViewTransform.modelToViewY( model.beaker.location.y ) - pHMeterTop, viewProperties.pHMeterExpandedProperty, - { attachProbe: 'right' } ); + const pHMeterNode = new PHMeterNode( model.solution, + modelViewTransform.modelToViewY( model.beaker.position.y ) - pHMeterTop, + viewProperties.pHMeterExpandedProperty, + { attachProbe: 'right' } + ); // solutes combo box const soluteListParent = new Node(); @@ -133,7 +136,7 @@ define( require => { } ); this.addChild( rootNode ); - // Layout of nodes that don't have a location specified in the model + // Layout of nodes that don't have a position specified in the model moleculeCountNode.centerX = beakerNode.centerX; moleculeCountNode.bottom = beakerNode.bottom - 25; beakerControls.centerX = beakerNode.centerX; diff --git a/js/mysolution/view/MySolutionScreenView.js b/js/mysolution/view/MySolutionScreenView.js index 77db7216..fcc42360 100644 --- a/js/mysolution/view/MySolutionScreenView.js +++ b/js/mysolution/view/MySolutionScreenView.js @@ -68,8 +68,11 @@ define( require => { // pH meter const pHMeterTop = 15; - const pHMeterNode = new PHMeterNode( model.solution, modelViewTransform.modelToViewY( model.beaker.location.y ) - pHMeterTop, viewProperties.pHMeterExpandedProperty, - { attachProbe: 'right', isInteractive: true } ); + const pHMeterNode = new PHMeterNode( model.solution, + modelViewTransform.modelToViewY( model.beaker.position.y ) - pHMeterTop, + viewProperties.pHMeterExpandedProperty, + { attachProbe: 'right', isInteractive: true } + ); const resetAllButton = new ResetAllButton( { scale: 1.32, @@ -97,7 +100,7 @@ define( require => { } ); this.addChild( rootNode ); - // Layout of nodes that don't have a location specified in the model + // Layout of nodes that don't have a position specified in the model pHMeterNode.left = beakerNode.left; pHMeterNode.top = pHMeterTop; moleculeCountNode.centerX = beakerNode.centerX;