Comparing version 0.2.3 to 0.2.4
@@ -137,3 +137,3 @@ /* | ||
Atlas.prototype.uv = function() { | ||
Atlas.prototype.uv = function(w, h) { | ||
var self = this; | ||
@@ -143,2 +143,4 @@ if (self._uvcache.length > 0) { | ||
} | ||
w = w || self.rect.w; | ||
h = h || self.rect.h; | ||
var isPad = this.tilepad; | ||
@@ -158,6 +160,6 @@ (function loop(atlas) { | ||
if (uv[0] !== 0) { | ||
uv[0] = uv[0] / self.rect.w; | ||
uv[0] = uv[0] / w; | ||
} | ||
if (uv[1] !== 0) { | ||
uv[1] = uv[1] / self.rect.h; | ||
uv[1] = uv[1] / h; | ||
} | ||
@@ -164,0 +166,0 @@ return uv; |
{ | ||
"name": "atlaspack", | ||
"description": "Pack rectangles (or images) into a rectangle (or canvas texture atlas).", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"homepage": "https://github.com/shama/atlaspack", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -127,3 +127,3 @@ # atlaspack | ||
#### `atlas.uv()` | ||
#### `atlas.uv([width, height])` | ||
Returns an object with rect names as keys containing an array of UV mapping | ||
@@ -140,2 +140,5 @@ coordinates between 0-1 with TRBL: | ||
Specify a `width` and `height` to override the dimensions the UVs will calculate | ||
from. Otherwise it will use the `atlas.rect` width and height. | ||
#### `atlas.json([input])` | ||
@@ -176,2 +179,3 @@ Exports or imports a JSON key for the ability to save the atlas state and | ||
## release history | ||
* 0.2.4 - Add width/height overrides to uv method. | ||
* 0.2.3 - Add tilepad property to help with mipmapping. | ||
@@ -178,0 +182,0 @@ * 0.2.2 - Ability to get and set JSON key. |
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
18276
358
187