From 8f55ffc24852d047ebb6818f9bbf42002d052bd9 Mon Sep 17 00:00:00 2001 From: samreid Date: Fri, 26 Feb 2021 07:40:30 -0700 Subject: [PATCH] Apply WebStorm formatting, see https://github.com/phetsims/phet-info/issues/155 --- js/common/model/DerivativeCurve.js | 14 +++++++------- js/common/model/OriginalCurve.js | 4 ++-- js/common/view/CalculusGrapherIconFactory.js | 2 +- js/common/view/CalculusGrapherViewProperties.js | 4 ++-- js/common/view/CurveNode.js | 2 +- js/common/view/OriginalCurveNode.js | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/js/common/model/DerivativeCurve.js b/js/common/model/DerivativeCurve.js index 8e1fa566..9a880dd4 100644 --- a/js/common/model/DerivativeCurve.js +++ b/js/common/model/DerivativeCurve.js @@ -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 ); } diff --git a/js/common/model/OriginalCurve.js b/js/common/model/OriginalCurve.js index 4d899b12..05278598 100644 --- a/js/common/model/OriginalCurve.js +++ b/js/common/model/OriginalCurve.js @@ -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; } } } diff --git a/js/common/view/CalculusGrapherIconFactory.js b/js/common/view/CalculusGrapherIconFactory.js index c6cd928b..096b00aa 100644 --- a/js/common/view/CalculusGrapherIconFactory.js +++ b/js/common/view/CalculusGrapherIconFactory.js @@ -58,7 +58,7 @@ const CalculusGrapherIconFactory = { }, - /** + /** * Creates the Curve Manipulation Icon for CurveManipulationModes.PARABOLA. * @public * diff --git a/js/common/view/CalculusGrapherViewProperties.js b/js/common/view/CalculusGrapherViewProperties.js index c6a61ed4..5c3a60f2 100644 --- a/js/common/view/CalculusGrapherViewProperties.js +++ b/js/common/view/CalculusGrapherViewProperties.js @@ -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 ); } diff --git a/js/common/view/CurveNode.js b/js/common/view/CurveNode.js index d9509f77..b7b6d9bd 100644 --- a/js/common/view/CurveNode.js +++ b/js/common/view/CurveNode.js @@ -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 ), diff --git a/js/common/view/OriginalCurveNode.js b/js/common/view/OriginalCurveNode.js index b684ff41..7540438a 100644 --- a/js/common/view/OriginalCurveNode.js +++ b/js/common/view/OriginalCurveNode.js @@ -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 );