Feature Request: Add diagonal sprites

Bug #614406 reported by Aaron Barker
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
CSS Sprite Generator
Triaged
Wishlist
Unassigned

Bug Description

As a history it may be easier to point you to my article http://www.aaronbarker.net/2010/07/diagonal-sprites/

As you can see in the article, I am using a modified version of your script to do create the diagonal sprite. I thought that instead of me trying to make another resource for people to go to, that maybe you would like to update your script to be able to handle the diagonal option as well.

It seems it would fit as an option in your "Build direction" dropdown.

If you are interested, please let me know if you would like to see my fairly hackish version of your script. I'm positive you can write it much better then I did, but it got the job done :)

Revision history for this message
Stuart Colville (muffinresearch) wrote :

Thanks for the suggestion, would you be able to push a branch containing your addition or attach a patch to this ticket so we can take a look?

Changed in css-sprite-generator:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Aaron Barker (r-launchpad-zbarkers-com) wrote :

I'm a designer who knows enough php to be dangerous so I don't get the whole "push a branch" thing (I feel so incompetent) but I guess I can attach my hacked file.

Basically I had to make it run both the horizontal and vertical layout stuff as I wanted the size of the image to both get wider and taller as it added each component (not one or the other). So I just commented out the if/else stuff anywhere it asked about the build-direction.

Since it ran both the horizontal and vertical code, it figured out what the x/y would have been in both directions instead of one of those coordinates always being 0. I then left the Y coordinate as figured, but then made the X coordinate be backwards from the right side of the image (imageWidth - curFileWidth - curFileX) as the diagonal had to be a / not a \.

Hopefully a diff with my file against yours will make some kind of sense. I also had to do some hacking to get optipng working locally so a few lines are hacked for that.

Sorry that I'm not up to the task of an official patch. I hacked it enough to work, and even then it only produces diagonals for now in my version.

Let me know if you need something else from me.

Revision history for this message
Aaron Barker (r-launchpad-zbarkers-com) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.