Skip to content

Commit

Permalink
factor out var, fix arrow min width, #76
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jul 29, 2019
1 parent 57cd48d commit 673c5fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/view/ISLCForceArrowNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ define( function( require ) {

// constants
var ARROW_LENGTH = 8; // empirically determined
var ARROW_WIDTH_MIN = 1; // empirically determined
var ARROW_WIDTH_MIN = 0; // Some ISLC sims support an object value of zero, this must be zero to support this case.
var TEXT_OFFSET = 10; // empirically determined to make sure text does not go out of bounds

/**
Expand Down
7 changes: 5 additions & 2 deletions js/view/ISLCObjectNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,11 @@ define( require => {
// @public - which object this instance is (one or two)
this.enum = object === model.object1 ? ISLCObjectEnum.OBJECT_ONE : ISLCObjectEnum.OBJECT_TWO;

// Used by arrows and puller
const modelMaxForce = model.getMaxForce();

// the full range of force for the arrow node (note: this is distinct)
const arrowForceRange = new Range( model.getMinForceMagnitude(), model.getMaxForce() );
const arrowForceRange = new Range( model.getMinForceMagnitude(), modelMaxForce );

// @protected - arrow node
this.arrowNode = new ISLCForceArrowNode(
Expand All @@ -155,7 +158,7 @@ define( require => {

// @private - the puller node
this.pullerNode = new ISLCPullerNode(
new Range( model.getMinForce(), model.getMaxForce() ),
new Range( model.getMinForce(), modelMaxForce ),
config.tandem.createTandem( 'pullerNode' ),
config.pullerNodeOptions
);
Expand Down

0 comments on commit 673c5fc

Please sign in to comment.