Skip to content

Commit

Permalink
fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Sep 15, 2019
1 parent 5b0d34b commit 9ca21c1
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 20 deletions.
7 changes: 3 additions & 4 deletions src/body/Body.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ var Axes = require('../geometry/Axes');
}

for (property in settings) {

if (!settings.hasOwnProperty(property))
if (!Object.prototype.hasOwnProperty.call(settings, property))
continue;

value = settings[property];
Expand Down Expand Up @@ -1162,15 +1161,15 @@ var Axes = require('../geometry/Axes');
* @default 1
*/

/**
/**
* A `Number` that defines the offset in the x-axis for the sprite (normalised by texture width).
*
* @property render.sprite.xOffset
* @type number
* @default 0
*/

/**
/**
* A `Number` that defines the offset in the y-axis for the sprite (normalised by texture height).
*
* @property render.sprite.yOffset
Expand Down
4 changes: 2 additions & 2 deletions src/body/Composite.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,8 @@ var Body = require('./Body');
*/
Composite.rebase = function(composite) {
var objects = Composite.allBodies(composite)
.concat(Composite.allConstraints(composite))
.concat(Composite.allComposites(composite));
.concat(Composite.allConstraints(composite))
.concat(Composite.allComposites(composite));

for (var i = 0; i < objects.length; i++) {
objects[i].id = Common.nextId();
Expand Down
4 changes: 2 additions & 2 deletions src/body/World.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ var Common = require('../core/Common');
* @return {world} The original world with the objects from composite added
*/

/**
/**
* An alias for Composite.addBody
* @method addBody
* @param {world} world
* @param {body} body
* @return {world} The original world with the body added
*/

/**
/**
* An alias for Composite.addConstraint
* @method addConstraint
* @param {world} world
Expand Down
6 changes: 3 additions & 3 deletions src/factory/Bodies.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var Vector = require('../geometry/Vector');
if (options.chamfer) {
var chamfer = options.chamfer;
rectangle.vertices = Vertices.chamfer(rectangle.vertices, chamfer.radius,
chamfer.quality, chamfer.qualityMin, chamfer.qualityMax);
chamfer.quality, chamfer.qualityMin, chamfer.qualityMax);
delete options.chamfer;
}

Expand Down Expand Up @@ -91,7 +91,7 @@ var Vector = require('../geometry/Vector');
if (options.chamfer) {
var chamfer = options.chamfer;
trapezoid.vertices = Vertices.chamfer(trapezoid.vertices, chamfer.radius,
chamfer.quality, chamfer.qualityMin, chamfer.qualityMax);
chamfer.quality, chamfer.qualityMin, chamfer.qualityMax);
delete options.chamfer;
}

Expand Down Expand Up @@ -168,7 +168,7 @@ var Vector = require('../geometry/Vector');
if (options.chamfer) {
var chamfer = options.chamfer;
polygon.vertices = Vertices.chamfer(polygon.vertices, chamfer.radius,
chamfer.quality, chamfer.qualityMin, chamfer.qualityMax);
chamfer.quality, chamfer.qualityMin, chamfer.qualityMax);
delete options.chamfer;
}

Expand Down
2 changes: 1 addition & 1 deletion src/factory/Composites.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ var Bodies = require('./Bodies');
for (var i = 0; i < number; i++) {
var separation = 1.9,
circle = Bodies.circle(xx + i * (size * separation), yy + length, size,
{ inertia: Infinity, restitution: 1, friction: 0, frictionAir: 0.0001, slop: 1 }),
{ inertia: Infinity, restitution: 1, friction: 0, frictionAir: 0.0001, slop: 1 }),
constraint = Constraint.create({ pointA: { x: xx + i * (size * separation), y: yy }, bodyB: circle });

Composite.addBody(newtonsCradle, circle);
Expand Down
2 changes: 1 addition & 1 deletion src/geometry/Vertices.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var Common = require('../core/Common');
* @return {vertices} vertices
*/
Vertices.fromPath = function(path, body) {
var pathPattern = /L?\s*([\-\d\.e]+)[\s,]*([\-\d\.e]+)*/ig,
var pathPattern = /L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/ig,
points = [];

path.replace(pathPattern, function(match, x, y) {
Expand Down
12 changes: 6 additions & 6 deletions src/render/Render.js
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ var Mouse = require('../core/Mouse');
// render a single axis indicator
c.moveTo(part.position.x, part.position.y);
c.lineTo((part.vertices[0].x + part.vertices[part.vertices.length-1].x) / 2,
(part.vertices[0].y + part.vertices[part.vertices.length-1].y) / 2);
(part.vertices[0].y + part.vertices[part.vertices.length-1].y) / 2);
}
}
}
Expand Down Expand Up @@ -1227,9 +1227,9 @@ var Mouse = require('../core/Mouse');

var region = bucketId.split(/C|R/);
c.rect(0.5 + parseInt(region[1], 10) * grid.bucketWidth,
0.5 + parseInt(region[2], 10) * grid.bucketHeight,
grid.bucketWidth,
grid.bucketHeight);
0.5 + parseInt(region[2], 10) * grid.bucketHeight,
grid.bucketWidth,
grid.bucketHeight);
}

c.lineWidth = 1;
Expand Down Expand Up @@ -1276,7 +1276,7 @@ var Mouse = require('../core/Mouse');
bounds = item.bounds;
context.beginPath();
context.rect(Math.floor(bounds.min.x - 3), Math.floor(bounds.min.y - 3),
Math.floor(bounds.max.x - bounds.min.x + 6), Math.floor(bounds.max.y - bounds.min.y + 6));
Math.floor(bounds.max.x - bounds.min.x + 6), Math.floor(bounds.max.y - bounds.min.y + 6));
context.closePath();
context.stroke();

Expand Down Expand Up @@ -1310,7 +1310,7 @@ var Mouse = require('../core/Mouse');
bounds = inspector.selectBounds;
context.beginPath();
context.rect(Math.floor(bounds.min.x), Math.floor(bounds.min.y),
Math.floor(bounds.max.x - bounds.min.x), Math.floor(bounds.max.y - bounds.min.y));
Math.floor(bounds.max.x - bounds.min.x), Math.floor(bounds.max.y - bounds.min.y));
context.closePath();
context.stroke();
context.fill();
Expand Down
2 changes: 1 addition & 1 deletion src/render/RenderPixi.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ var Vector = require('../geometry/Vector');

primitive.moveTo(part.position.x - body.position.x, part.position.y - body.position.y);
primitive.lineTo(((part.vertices[0].x + part.vertices[part.vertices.length-1].x) / 2 - body.position.x),
((part.vertices[0].y + part.vertices[part.vertices.length-1].y) / 2 - body.position.y));
((part.vertices[0].y + part.vertices[part.vertices.length-1].y) / 2 - body.position.y));

primitive.endFill();
}
Expand Down

0 comments on commit 9ca21c1

Please sign in to comment.