Skip to content

Commit

Permalink
Apply WebStorm formatting, see phetsims/phet-info#155
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 26, 2021
1 parent 9b26f7c commit 8f55ffc
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions js/common/model/DerivativeCurve.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,20 @@ class DerivativeCurve extends Curve {

// Set the y-value of the corresponding Point of the DerivativeCurve.
if ( Number.isFinite( leftSlope ) && Number.isFinite( rightSlope ) ) {
const p0 = new Vector2( previousPoint.x, previousPoint.y ) ;
const p1 = new Vector2( point.x, point.y ) ;
const p2 = new Vector2( nextPoint.x, nextPoint.y ) ;
const p0 = new Vector2( previousPoint.x, previousPoint.y );
const p1 = new Vector2( point.x, point.y );
const p2 = new Vector2( nextPoint.x, nextPoint.y );

const dx1 = p1.x - p0.x;
const dy1 = p1.y - p0.y;
const dx2 = p2.x - p0.x;
const dy2 = p2.y - p0.y;
const area = dx1 * dy2 - dy1 * dx2;
const len0 = p0.distance(p1);
const len1 = p1.distance(p2);
const len2 = p2.distance(p0);
const len0 = p0.distance( p1 );
const len1 = p1.distance( p2 );
const len2 = p2.distance( p0 );

const K = 4 * Math.abs( area ) / (len0 * len1 * len2);
const K = 4 * Math.abs( area ) / ( len0 * len1 * len2 );
if ( K >= DERIVATIVE_THRESHOLD ) {
this.baseCurve.cusps.push( point );
}
Expand Down
4 changes: 2 additions & 2 deletions js/common/model/OriginalCurve.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,10 @@ class OriginalCurve extends Curve {
const W = dx / distX;

if ( closestPoint.x > this.last.x ) {
this.getClosestPointAt( this.last.x + dx ).y = (1 - W) * this.last.y + W * closestPoint.y;
this.getClosestPointAt( this.last.x + dx ).y = ( 1 - W ) * this.last.y + W * closestPoint.y;
}
else {
this.getClosestPointAt( this.last.x - dx ).y = (1 - W) * this.last.y + W * closestPoint.y;
this.getClosestPointAt( this.last.x - dx ).y = ( 1 - W ) * this.last.y + W * closestPoint.y;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion js/common/view/CalculusGrapherIconFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const CalculusGrapherIconFactory = {

},

/**
/**
* Creates the Curve Manipulation Icon for CurveManipulationModes.PARABOLA.
* @public
*
Expand Down
4 changes: 2 additions & 2 deletions js/common/view/CalculusGrapherViewProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class CalculusGrapherViewProperties {
// @public {BooleanProperty} - indicates if the integral curve is visible.
this.integralCurveVisibleProrperty = new BooleanProperty( false );

// @public {BooleanProperty} - indicates if the derivative curve is visible.
// @public {BooleanProperty} - indicates if the derivative curve is visible.
this.derivativeCurveVisibleProrperty = new BooleanProperty( false );

// @public {BooleanProperty} - indicates if the second derivative curve is visible.
// @public {BooleanProperty} - indicates if the second derivative curve is visible.
this.secondDerivativeCurveVisibleProrperty = new BooleanProperty( false );
}

Expand Down
2 changes: 1 addition & 1 deletion js/common/view/CurveNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class CurveNode extends Node {
* Updates the CurveNode
* @public
*/
updateCurveNode() { // TODO: pass modelViewTransformProperty value?
updateCurveNode() { // TODO: pass modelViewTransformProperty value?

const pathShape = new Shape().moveTo(
this.modelViewTransformProperty.value.modelToViewX( this.curve.points[ 0 ].x ),
Expand Down
2 changes: 1 addition & 1 deletion js/common/view/OriginalCurveNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class OriginalCurveNode extends CurveNode {
* Forwards response to super-class, except this adds a dilation to the touch/mouse area of the Path.
* @public
*/
updateCurveNode() {
updateCurveNode() {
super.updateCurveNode();

const dilatedPathShape = OriginalCurveNode.createDilatedCurvePath( this.curve );
Expand Down

0 comments on commit 8f55ffc

Please sign in to comment.