Skip to content

Commit

Permalink
Renamed rulerProperty=>rulerPositionProperty and changed type to Vect…
Browse files Browse the repository at this point in the history
…or2, see #78
  • Loading branch information
samreid committed Nov 13, 2016
1 parent 6689cf5 commit 5f23ab9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions js/gravity-force-lab/model/GravityForceLabModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ define( function( require ) {
var Mass = require( 'GRAVITY_FORCE_LAB/gravity-force-lab/model/Mass' );
var Property = require( 'AXON/Property' );
var RangeWithValue = require( 'DOT/RangeWithValue' );
var Vector2 = require( 'DOT/Vector2' );

// constants
var G = 6.67384E-11; // gravitational constant
Expand Down Expand Up @@ -43,7 +44,7 @@ define( function( require ) {
this.forceProperty = new Property( 0 ); // @public (read-only)
this.showValuesProperty = new Property( true ); // @public
this.constantRadiusProperty = new Property( false ); // @public
this.rulerProperty = new Property( { x: 120, y: 270 } ); // @public
this.rulerPositionProperty = new Property( new Vector2( 120, 270 ) ); // @public

this.mass1 = new Mass( 50, -2, '#00f', this.constantRadiusProperty ); // @public
this.mass2 = new Mass( 200, 2, '#f00', this.constantRadiusProperty ); // @public
Expand Down Expand Up @@ -116,7 +117,7 @@ define( function( require ) {
this.forceProperty.reset();
this.showValuesProperty.reset();
this.constantRadiusProperty.reset();
this.rulerProperty.reset();
this.rulerPositionProperty.reset();
this.mass1.reset();
this.mass2.reset();
this.updateForce();
Expand Down
4 changes: 2 additions & 2 deletions js/gravity-force-lab/view/GravityForceLabRuler.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ define( function( require ) {
} );
this.addChild( ruler );

model.rulerProperty.link( function( value ) {
model.rulerPositionProperty.link( function( value ) {
ruler.x = value.x;
ruler.y = value.y;
} );

this.addInputListener( new MovableDragHandler( model.rulerProperty, {
this.addInputListener( new MovableDragHandler( model.rulerPositionProperty, {
dragBounds: new Bounds2( -self.width / 2, 0, screenWidth - self.width / 2, screenHeight - self.height )
} ) );
}
Expand Down

0 comments on commit 5f23ab9

Please sign in to comment.