Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sprite padding does not work with retina #12

Closed
manuatdoodle opened this issue Jun 3, 2016 · 1 comment
Closed

sprite padding does not work with retina #12

manuatdoodle opened this issue Jun 3, 2016 · 1 comment

Comments

@manuatdoodle
Copy link

Hello

if I specify a padding for Spritesmith in the spritesmithOptions config, the generated normal sprite image is correct, but the retina sprite gets the same padding. It should get double padding.

gulp-spritesmith does it correctly:

    // Prepare spritesmith parameters
    var spritesmithParams = {
      engine: params.engine,
      algorithm: params.algorithm,
      padding: params.padding || 0,
      algorithmOpts: params.algorithmOpts || {},
      engineOpts: params.engineOpts || {},
      exportOpts: imgOpts
    };
    var that = this;

    // Construct our spritesmiths
    var spritesmith = new Spritesmith(spritesmithParams);
    var retinaSpritesmithParams;
    var retinaSpritesmith;
    if (retinaImages) {
      retinaSpritesmithParams = _.defaults({
        padding: spritesmithParams.padding * 2 <========= HERE ;)
      }, spritesmithParams);
      retinaSpritesmith = new Spritesmith(retinaSpritesmithParams);
    }

Something could be done I guess in function getSpritesmithConfig(field) in compileRetina.js

Thanks.

@mixtur
Copy link
Owner

mixtur commented Jun 3, 2016

NIce catch thanks

@mixtur mixtur closed this as completed in 168111b Jun 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants