twolfson / layout

Organize and layout items based on various algorithms
MIT License
113 stars 15 forks source link

Add parameter to bypass sorting #5

Closed twolfson closed 10 years ago

twolfson commented 10 years ago

As with Ensighten/spritesmith#25, it would be nice if we could bypass sorting via an option. The layout algorithm would not be as optimal but it allows for the 20% (in 80/20) to get by.

JulienCabanes commented 10 years ago

+1 for bypassing sorting I'm using grunt-spritesmith without the CSS part, only the spriting and I need to keep the original order (some kind of PNG animation)

twolfson commented 10 years ago

I will not be able to get to this this week. I will post when I am going to take it on. In the meantime, we accept PRs =D

uberbruns commented 10 years ago

+1 … Today I implemented with spritesmith a loading indicator with a CSS3-Animation similar to this one: http://cssdeck.com/labs/css-image-sprite-animations-with-steps-function

But the frames ended up in an unpredictable order. Based upon the top-down-layout I added a custom layout that sorts the assets by filename. Since this implementation relies on the filenames provided by spritesmith I hesitated to make a pull request.

Maybe the best solution really would be, that there is an option, that the layout algorithm respects the input order.

thx, Karsten

fregante commented 10 years ago

+1

Same exact situation as @JulienCabanes, the sorting was throwing me off. Why sort it at all, though? Aesthetic purposes?

In the meanwhile I had to comment out the sorting, but I wish I had not to.

twolfson commented 10 years ago

The initial intent was consistent ordering. Also, from an abstraction perspective, if you are laying items out, you will probably want them to be sorted.

I am almost free to take this on but I will accepts PR in the mean time.

twolfson commented 10 years ago

Attempting to take care of this tonight. We will see how far I get.

twolfson commented 10 years ago

This has been released in 2.0.0. There will probably new tests to verify this works coming in spritesmith (and more option passing in grunt-spritesmith/gulp.spritesmith).

twolfson commented 10 years ago

Alright, the higher level modules have been upgraded and now support the appropriate options (algorithmOpts).

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