Socket
Socket
Sign inDemoInstall

grunt-tight-sprite

Package Overview
Dependencies
58
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 0.2.1

tests/icons/sprite1.css

6

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc