grunt-tight-sprite
Advanced tools
Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "grunt-tight-sprite", | ||
"description": "Tight 2D packing of images into a sprite with a corresponding CSS.", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"homepage": "https://github.com/uhop/grunt-tight-sprite/wiki", | ||
@@ -38,4 +38,4 @@ "author": { | ||
"image-size": "^0.3.0", | ||
"lodash.template": "~2.4.1", | ||
"tight-sprite": ">=0.1" | ||
"lodash.template": "~3.6.1", | ||
"tight-sprite": ">=0.1.5" | ||
}, | ||
@@ -42,0 +42,0 @@ "devDependencies": { |
# grunt-tight-sprite | ||
[![Build Status](https://secure.travis-ci.org/uhop/grunt-tight-sprite.png?branch=master)](http://travis-ci.org/uhop/grunt-tight-sprite) [![Dependency Status](https://david-dm.org/uhop/grunt-tight-sprite.png)](https://david-dm.org/uhop/grunt-tight-sprite) [![devDependency Status](https://david-dm.org/uhop/grunt-tight-sprite/dev-status.png)](https://david-dm.org/uhop/grunt-tight-sprite#info=devDependencies) | ||
[![Build status][travis-image]][travis-url] | ||
[![Dependencies][deps-image]][deps-url] | ||
[![devDependencies][dev-deps-image]][dev-deps-url] | ||
[![NPM version][npm-image]][npm-url] | ||
> Tight 2D packing of images into a sprite with a corresponding CSS. | ||
@@ -53,2 +57,3 @@ | ||
## Contributing | ||
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/). | ||
@@ -58,2 +63,3 @@ | ||
- 0.2.1 *added the ability to pad images.* | ||
- 0.2.0 *stability fixes, more flexible template options.* | ||
@@ -70,1 +76,10 @@ - 0.1.9 *added the ability to specify dot and path separators.* | ||
- 0.1.0 *the initial release.* | ||
[npm-image]: https://img.shields.io/npm/v/grunt-tight-sprite.svg | ||
[npm-url]: https://npmjs.org/package/grunt-tight-sprite | ||
[deps-image]: https://img.shields.io/david/uhop/grunt-tight-sprite.svg | ||
[deps-url]: https://david-dm.org/uhop/grunt-tight-sprite | ||
[dev-deps-image]: https://img.shields.io/david/dev/uhop/grunt-tight-sprite.svg | ||
[dev-deps-url]: https://david-dm.org/uhop/grunt-tight-sprite#info=devDependencies | ||
[travis-image]: https://img.shields.io/travis/uhop/grunt-tight-sprite.svg | ||
[travis-url]: https://travis-ci.org/uhop/grunt-tight-sprite |
@@ -61,4 +61,8 @@ "use strict"; | ||
silent: false, | ||
fragment: true | ||
fragment: true, | ||
padding: 0 | ||
}); | ||
if(isNaN(options.padding) || options.padding < 0){ | ||
options.padding = 0; | ||
} | ||
@@ -76,2 +80,3 @@ this.files.forEach(function(file){ | ||
size = sizeOf(name); | ||
return { | ||
@@ -82,4 +87,4 @@ name: name, | ||
extension: path.extname(shortName), | ||
w: size.width, | ||
h: size.height | ||
w: size.width + options.padding, | ||
h: size.height + options.padding | ||
}; | ||
@@ -110,2 +115,5 @@ }).sort(function(a, b){ | ||
size.w += options.padding; | ||
size.h += options.padding; | ||
// prepare rectangles | ||
@@ -136,6 +144,6 @@ | ||
extension: rect.extension, | ||
w: rect.w, | ||
h: rect.h, | ||
x: pos.x, | ||
y: pos.y, | ||
w: rect.w - options.padding, | ||
h: rect.h - options.padding, | ||
x: pos.x + options.padding, | ||
y: pos.y + options.padding, | ||
url: url, | ||
@@ -142,0 +150,0 @@ size: size, |
Sorry, the diff of this file is not supported yet
1205740
179
383
83
+ Addedlodash._basecopy@3.0.1(transitive)
+ Addedlodash._basetostring@3.0.1(transitive)
+ Addedlodash._basevalues@3.0.0(transitive)
+ Addedlodash._getnative@3.9.1(transitive)
+ Addedlodash._isiterateecall@3.0.9(transitive)
+ Addedlodash._reinterpolate@3.0.0(transitive)
+ Addedlodash._root@3.0.1(transitive)
+ Addedlodash.escape@3.2.0(transitive)
+ Addedlodash.isarguments@3.1.0(transitive)
+ Addedlodash.isarray@3.0.4(transitive)
+ Addedlodash.keys@3.1.2(transitive)
+ Addedlodash.restparam@3.6.1(transitive)
+ Addedlodash.template@3.6.2(transitive)
+ Addedlodash.templatesettings@3.1.1(transitive)
- Removedlodash._escapehtmlchar@2.4.1(transitive)
- Removedlodash._escapestringchar@2.4.1(transitive)
- Removedlodash._htmlescapes@2.4.1(transitive)
- Removedlodash._isnative@2.4.1(transitive)
- Removedlodash._objecttypes@2.4.1(transitive)
- Removedlodash._reinterpolate@2.4.1(transitive)
- Removedlodash._reunescapedhtml@2.4.1(transitive)
- Removedlodash._shimkeys@2.4.1(transitive)
- Removedlodash.defaults@2.4.1(transitive)
- Removedlodash.escape@2.4.1(transitive)
- Removedlodash.isobject@2.4.1(transitive)
- Removedlodash.keys@2.4.1(transitive)
- Removedlodash.template@2.4.1(transitive)
- Removedlodash.templatesettings@2.4.1(transitive)
- Removedlodash.values@2.4.1(transitive)
Updatedlodash.template@~3.6.1
Updatedtight-sprite@>=0.1.5