diff --git a/src/body/Body.js b/src/body/Body.js index 39e0a9a..9c39195 100644 --- a/src/body/Body.js +++ b/src/body/Body.js @@ -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]; @@ -1162,7 +1161,7 @@ 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 @@ -1170,7 +1169,7 @@ var Axes = require('../geometry/Axes'); * @default 0 */ - /** + /** * A `Number` that defines the offset in the y-axis for the sprite (normalised by texture height). * * @property render.sprite.yOffset diff --git a/src/body/Composite.js b/src/body/Composite.js index 6df050a..26f220a 100644 --- a/src/body/Composite.js +++ b/src/body/Composite.js @@ -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(); diff --git a/src/body/World.js b/src/body/World.js index 8a4cbce..3db3727 100644 --- a/src/body/World.js +++ b/src/body/World.js @@ -128,7 +128,7 @@ 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 @@ -136,7 +136,7 @@ var Common = require('../core/Common'); * @return {world} The original world with the body added */ - /** + /** * An alias for Composite.addConstraint * @method addConstraint * @param {world} world diff --git a/src/factory/Bodies.js b/src/factory/Bodies.js index e27a93c..70c8efd 100644 --- a/src/factory/Bodies.js +++ b/src/factory/Bodies.js @@ -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; } @@ -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; } @@ -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; } diff --git a/src/factory/Composites.js b/src/factory/Composites.js index 3c9adf7..cc509f0 100644 --- a/src/factory/Composites.js +++ b/src/factory/Composites.js @@ -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); diff --git a/src/geometry/Vertices.js b/src/geometry/Vertices.js index 1b98fa5..70e50dc 100644 --- a/src/geometry/Vertices.js +++ b/src/geometry/Vertices.js @@ -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) { diff --git a/src/render/Render.js b/src/render/Render.js index 8decab5..f3f4ef2 100644 --- a/src/render/Render.js +++ b/src/render/Render.js @@ -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); } } } @@ -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; @@ -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(); @@ -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(); diff --git a/src/render/RenderPixi.js b/src/render/RenderPixi.js index 9b2ef50..4f28345 100644 --- a/src/render/RenderPixi.js +++ b/src/render/RenderPixi.js @@ -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(); }