Comparing version 1.0.0 to 1.1.0
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"homepage": "https://github.com/maxkueng/victor", | ||
@@ -11,0 +11,0 @@ "authors": [ |
21
index.js
@@ -793,2 +793,23 @@ exports = module.exports = Victor; | ||
/** | ||
* Rounds both axis to a certain precision | ||
* | ||
* ### Examples: | ||
* var vec = new Victor(100.2, 50.9); | ||
* | ||
* vec.unfloat(); | ||
* vec.toString(); | ||
* // => x:100, y:51 | ||
* | ||
* @param {Number} Precision (default: 8) | ||
* @return {Victor} `this` for chaining capabilities | ||
* @api public | ||
*/ | ||
Victor.prototype.toFixed = function (precision) { | ||
if (typeof precision === 'undefined') { precision = 8; } | ||
this.x = this.x.toFixed(precision); | ||
this.y = this.y.toFixed(precision); | ||
return this; | ||
}; | ||
/** | ||
* Performs a linear blend / interpolation of the X axis towards another vector | ||
@@ -795,0 +816,0 @@ * |
{ | ||
"name": "victor", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"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
33725
10
1266