twolfson/grunt-spritesmith

the order is not complied

Closed this issue · 6 comments

hi,

I have 1.png...9.png,10.png, 11.png....21.png and the order into the sprite is 1,10,11,12.....,2,20,21... and when i use a.png, b.png ,....etc , the order is not correct

There is an open issue in twolfson/layout#5 to bypass sorting. If that does not line up with your goals, can you please explain your use case further?

I don't use Stylus or Less , for my example i juste need generate image sprite (css file is optional for me). When i use your script i have this result (see image)

sprites

Yep, your issue lines up verbatim with the mentioned issue. The ideal solution is add an option to stop layout (decides place images on a canvas) from performing sorting.

twolfson/layout#5

Sorting can be turned off from version 1.26 on. Just use the follwing configuration (see Readme):

// OPTIONAL: Specify settings for algorithm
'algorithmOpts': {
     // Skip sorting of images for algorithm (useful for sprite animations)
     'sort': false
}

Issue can be closed.

Ah, yep. I closed twolfson/layout#5 but not this. This was released in:

spritesmith@0.19.0, grunt-spritesmith@1.26.0, gulp.spritesmith@0.5.0

Thanks @master-lincoln for the bump!