Comparing version 0.1.1 to 0.1.2
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"homepage": "https://github.com/maxkueng/victor", | ||
@@ -11,0 +11,0 @@ "authors": [ |
55
index.js
@@ -314,2 +314,57 @@ exports = module.exports = Victor; | ||
/** | ||
* Inverts the X axis | ||
* | ||
* ### Examples: | ||
* var vec = new Victor(100, 50); | ||
* | ||
* vec.invertX(); | ||
* vec.toString(); | ||
* // => x:-100, y:50 | ||
* | ||
* @return {Victor} `this` for chaining capabilities | ||
* @api public | ||
*/ | ||
Victor.prototype.invertX = function () { | ||
this.x *= -1; | ||
return this; | ||
}; | ||
/** | ||
* Inverts the Y axis | ||
* | ||
* ### Examples: | ||
* var vec = new Victor(100, 50); | ||
* | ||
* vec.invertY(); | ||
* vec.toString(); | ||
* // => x:100, y:-50 | ||
* | ||
* @return {Victor} `this` for chaining capabilities | ||
* @api public | ||
*/ | ||
Victor.prototype.invertY = function () { | ||
this.y *= -1; | ||
return this; | ||
}; | ||
/** | ||
* Inverts both axis | ||
* | ||
* ### Examples: | ||
* var vec = new Victor(100, 50); | ||
* | ||
* vec.invert(); | ||
* vec.toString(); | ||
* // => x:-100, y:-50 | ||
* | ||
* @return {Victor} `this` for chaining capabilities | ||
* @api public | ||
*/ | ||
Victor.prototype.invert = function () { | ||
this.invertX(); | ||
this.invertY(); | ||
return this; | ||
}; | ||
/** | ||
* Multiplies the X axis by a number | ||
@@ -316,0 +371,0 @@ * |
{ | ||
"name": "victor", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "A JavaScript 2D vector class with methods for common vector operations", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24470
913