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 304139d commit 6c2c567
Show file tree
Hide file tree
Showing 13 changed files with 69 additions and 4 deletions.
1 change: 1 addition & 0 deletions js/BinPacker.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ class Bin {
return this.bounds.toString() + ( this.isUsed ? ' used' : '' );
}
}

BinPacker.Bin = Bin;

export default BinPacker;
21 changes: 21 additions & 0 deletions js/Bounds2.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class Bounds2 {
* @returns {number}
*/
getWidth() { return this.maxX - this.minX; }

get width() { return this.getWidth(); }

/**
Expand All @@ -68,6 +69,7 @@ class Bounds2 {
* @returns {number}
*/
getHeight() { return this.maxY - this.minY; }

get height() { return this.getHeight(); }

/*
Expand All @@ -88,6 +90,7 @@ class Bounds2 {
* @returns {number}
*/
getX() { return this.minX; }

get x() { return this.getX(); }

/**
Expand All @@ -97,6 +100,7 @@ class Bounds2 {
* @returns {number}
*/
getY() { return this.minY; }

get y() { return this.getY(); }

/**
Expand Down Expand Up @@ -138,6 +142,7 @@ class Bounds2 {
* @returns {number}
*/
getLeft() { return this.minX; }

get left() { return this.minX; }

/**
Expand All @@ -147,6 +152,7 @@ class Bounds2 {
* @returns {number}
*/
getTop() { return this.minY; }

get top() { return this.minY; }

/**
Expand All @@ -156,6 +162,7 @@ class Bounds2 {
* @returns {number}
*/
getRight() { return this.maxX; }

get right() { return this.maxX; }

/**
Expand All @@ -165,6 +172,7 @@ class Bounds2 {
* @returns {number}
*/
getBottom() { return this.maxY; }

get bottom() { return this.maxY; }

/**
Expand All @@ -174,6 +182,7 @@ class Bounds2 {
* @returns {number}
*/
getCenterX() { return ( this.maxX + this.minX ) / 2; }

get centerX() { return this.getCenterX(); }

/**
Expand All @@ -183,6 +192,7 @@ class Bounds2 {
* @returns {number}
*/
getCenterY() { return ( this.maxY + this.minY ) / 2; }

get centerY() { return this.getCenterY(); }

/**
Expand All @@ -192,6 +202,7 @@ class Bounds2 {
* @returns {Vector2}
*/
getLeftTop() { return new dot.Vector2( this.minX, this.minY ); }

get leftTop() { return this.getLeftTop(); }

/**
Expand All @@ -201,6 +212,7 @@ class Bounds2 {
* @returns {Vector2}
*/
getCenterTop() { return new dot.Vector2( this.getCenterX(), this.minY ); }

get centerTop() { return this.getCenterTop(); }

/**
Expand All @@ -210,6 +222,7 @@ class Bounds2 {
* @returns {Vector2}
*/
getRightTop() { return new dot.Vector2( this.maxX, this.minY ); }

get rightTop() { return this.getRightTop(); }

/**
Expand All @@ -219,6 +232,7 @@ class Bounds2 {
* @returns {Vector2}
*/
getLeftCenter() { return new dot.Vector2( this.minX, this.getCenterY() ); }

get leftCenter() { return this.getLeftCenter(); }

/**
Expand All @@ -228,6 +242,7 @@ class Bounds2 {
* @returns {Vector2}
*/
getCenter() { return new dot.Vector2( this.getCenterX(), this.getCenterY() ); }

get center() { return this.getCenter(); }

/**
Expand All @@ -237,6 +252,7 @@ class Bounds2 {
* @returns {Vector2}
*/
getRightCenter() { return new dot.Vector2( this.maxX, this.getCenterY() ); }

get rightCenter() { return this.getRightCenter(); }

/**
Expand All @@ -246,6 +262,7 @@ class Bounds2 {
* @returns {Vector2}
*/
getLeftBottom() { return new dot.Vector2( this.minX, this.maxY ); }

get leftBottom() { return this.getLeftBottom(); }

/**
Expand All @@ -255,6 +272,7 @@ class Bounds2 {
* @returns {Vector2}
*/
getCenterBottom() { return new dot.Vector2( this.getCenterX(), this.maxY ); }

get centerBottom() { return this.getCenterBottom(); }

/**
Expand All @@ -264,6 +282,7 @@ class Bounds2 {
* @returns {Vector2}
*/
getRightBottom() { return new dot.Vector2( this.maxX, this.maxY ); }

get rightBottom() { return this.getRightBottom(); }

/**
Expand Down Expand Up @@ -539,6 +558,7 @@ class Bounds2 {
Math.min( this.maxY, bounds.maxY )
);
}

// TODO: difference should be well-defined, but more logic is needed to compute

/**
Expand Down Expand Up @@ -1401,6 +1421,7 @@ class Bounds2 {
if ( result.y > this.maxY ) { result.y = this.maxY; }
return result;
}

/**
* Returns a new Bounds2 object, with the familiar rectangle construction with x, y, width, and height.
* @public
Expand Down
17 changes: 17 additions & 0 deletions js/Bounds3.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class Bounds3 {
* @returns {number}
*/
getWidth() { return this.maxX - this.minX; }

get width() { return this.getWidth(); }

/**
Expand All @@ -73,6 +74,7 @@ class Bounds3 {
* @returns {number}
*/
getHeight() { return this.maxY - this.minY; }

get height() { return this.getHeight(); }

/**
Expand All @@ -82,6 +84,7 @@ class Bounds3 {
* @returns {number}
*/
getDepth() { return this.maxZ - this.minZ; }

get depth() { return this.getDepth(); }

/*
Expand All @@ -102,6 +105,7 @@ class Bounds3 {
* @returns {number}
*/
getX() { return this.minX; }

get x() { return this.getX(); }

/**
Expand All @@ -111,6 +115,7 @@ class Bounds3 {
* @returns {number}
*/
getY() { return this.minY; }

get y() { return this.getY(); }

/**
Expand All @@ -120,6 +125,7 @@ class Bounds3 {
* @returns {number}
*/
getZ() { return this.minZ; }

get z() { return this.getZ(); }

/**
Expand Down Expand Up @@ -177,6 +183,7 @@ class Bounds3 {
* @returns {number}
*/
getLeft() { return this.minX; }

get left() { return this.minX; }

/**
Expand All @@ -186,6 +193,7 @@ class Bounds3 {
* @returns {number}
*/
getTop() { return this.minY; }

get top() { return this.minY; }

/**
Expand All @@ -195,6 +203,7 @@ class Bounds3 {
* @returns {number}
*/
getBack() { return this.minZ; }

get back() { return this.minZ; }

/**
Expand All @@ -204,6 +213,7 @@ class Bounds3 {
* @returns {number}
*/
getRight() { return this.maxX; }

get right() { return this.maxX; }

/**
Expand All @@ -213,6 +223,7 @@ class Bounds3 {
* @returns {number}
*/
getBottom() { return this.maxY; }

get bottom() { return this.maxY; }

/**
Expand All @@ -222,6 +233,7 @@ class Bounds3 {
* @returns {number}
*/
getFront() { return this.maxZ; }

get front() { return this.maxZ; }

/**
Expand All @@ -231,6 +243,7 @@ class Bounds3 {
* @returns {number}
*/
getCenterX() { return ( this.maxX + this.minX ) / 2; }

get centerX() { return this.getCenterX(); }

/**
Expand All @@ -240,6 +253,7 @@ class Bounds3 {
* @returns {number}
*/
getCenterY() { return ( this.maxY + this.minY ) / 2; }

get centerY() { return this.getCenterY(); }

/**
Expand All @@ -249,6 +263,7 @@ class Bounds3 {
* @returns {number}
*/
getCenterZ() { return ( this.maxZ + this.minZ ) / 2; }

get centerZ() { return this.getCenterZ(); }

/**
Expand All @@ -258,6 +273,7 @@ class Bounds3 {
* @returns {Vector3}
*/
getCenter() { return new Vector3( this.getCenterX(), this.getCenterY(), this.getCenterZ() ); }

get center() { return this.getCenter(); }

/**
Expand Down Expand Up @@ -477,6 +493,7 @@ class Bounds3 {
Math.min( this.maxZ, bounds.maxZ )
);
}

// TODO: difference should be well-defined, but more logic is needed to compute

/**
Expand Down
3 changes: 3 additions & 0 deletions js/Complex.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Complex {
getMagnitude() {
return Math.sqrt( this.magnitudeSquared );
}

get magnitude() {
return this.getMagnitude();
}
Expand All @@ -79,6 +80,7 @@ class Complex {
getMagnitudeSquared() {
return this.real * this.real + this.imaginary * this.imaginary;
}

get magnitudeSquared() {
return this.getMagnitudeSquared();
}
Expand Down Expand Up @@ -462,6 +464,7 @@ class Complex {
toString() {
return 'Complex(' + this.real + ', ' + this.imaginary + ')';
}

/**
* Constructs a complex number from just the real part (assuming the imaginary part is 0).
* @public
Expand Down
1 change: 1 addition & 0 deletions js/DelaunayTriangulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ class DelaunayTriangulation {
this.legalizeEdge( triangle2Edge2 );
}
}

/**
* Comparison for sorting points by y, then by x.
* @private
Expand Down
Loading

0 comments on commit 6c2c567

Please sign in to comment.