Skip to content

Commit

Permalink
Added logic to remove vector arrows if the massNode is an icon. #250
Browse files Browse the repository at this point in the history
  • Loading branch information
Denz1994 committed May 15, 2018
1 parent be29567 commit 92833ff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
14 changes: 8 additions & 6 deletions js/common/view/MassNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,14 @@ define( function( require ) {
var springForceArrow = new ForceVectorArrow( MassesAndSpringsConstants.SPRING_ARROW_COLOR );
var netForceArrow = new ForceVectorArrow( 'black' );

this.addChild( velocityArrow );
this.addChild( accelerationArrow );
this.addChild( gravityForceArrow );
this.addChild( springForceArrow );
this.addChild( netForceArrow );
this.addChild( forceNullLine );
if ( !mass.icon ) {
this.addChild( velocityArrow );
this.addChild( accelerationArrow );
this.addChild( gravityForceArrow );
this.addChild( springForceArrow );
this.addChild( netForceArrow );
this.addChild( forceNullLine );
}

// Used to position the vectors on the left of right side of the massNode depending on the attached spring.
var forcesOrientation = 1;
Expand Down
9 changes: 4 additions & 5 deletions js/common/view/MassValueControlPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ define( function( require ) {
valuePattern: StringUtils.fillIn( massValueString, {
mass: '{0}'
} ),
valueFont: new PhetFont( 14 ),
valueFont: new PhetFont( 16 ),
majorTickLength: 10,
titleFont: new PhetFont( { size: 14, weight: 'bold' } ),
titleFont: new PhetFont( { size: 16, weight: 'bold' } ),
titleMaxWidth: 55,
trackSize: new Dimension2( 125, 0.1 ),
thumbSize: new Dimension2( 13, 24 ),
thumbFillEnabled: '#00C4DF',
thumbFillHighlighted: MassesAndSpringsConstants.THUMB_HIGHLIGHT,
stroke: null,
valueMaxWidth:40,
valueMaxWidth: 40,
sliderIndent: 7,
majorTicks: [
{
Expand Down Expand Up @@ -97,8 +97,7 @@ define( function( require ) {
xMargin: 6
} );

massNodeIcon.left = this.bounds.left;
massNodeIcon.centerY = numberControl.top + 6.5;
massNodeIcon.leftTop = numberControl.leftTop;
massNodeIcon.pickable = false;
}

Expand Down

0 comments on commit 92833ff

Please sign in to comment.