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 with smart layout not support sprite-spacing? #718

Open
doabit opened this issue Feb 14, 2012 · 21 comments

Comments

@doabit
Copy link

commented Feb 14, 2012

When i use sprite-layout with smart, sprite-spacing not work, does it not support sprite-spacing with smart layout?

$icon-spacing: 5px !default;
$icon-layout:"smart";

@doabit

This comment has been minimized.

Copy link
Author

commented Feb 14, 2012

I found http://beta.compass-style.org/help/tutorials/spriting/sprite-layouts/ and it shows not support configuration options

@doabit doabit closed this Feb 14, 2012

@scottdavis

This comment has been minimized.

Copy link
Member

commented Feb 14, 2012

Correct this is a limitation of smart layout

Sent from my iPhone

On Feb 14, 2012, at 9:34 AM, doabitreply@reply.github.com wrote:

When i use sprite-layout with smart, sprite-spacing not work, does it not support sprite-spacing with smart layout?

$icon-spacing: 5px !default;
$icon-layout:"smart";


Reply to this email directly or view it on GitHub:
#718

@afewyards

This comment has been minimized.

Copy link

commented Mar 26, 2013

why is this a limitation.. I find myself over and over again trying to get around some bugs because this isn't here.

@scottdavis

This comment has been minimized.

Copy link
Member

commented Mar 26, 2013

because of the packing algorithm. If you want to use spacing use horizontal or vertical.

@afewyards

This comment has been minimized.

Copy link

commented Mar 26, 2013

figured that it had something to do with the algorithm.. thing is that when you use the other ones it uses a larger PNG file if you want to fit in all those assets into it.. and when it exceeds 1024px the iPad < retina will not cache those files.. so you need to split up way quicker..

@afewyards

This comment has been minimized.

Copy link

commented Mar 26, 2013

can you otherwise point me in the direction where the algoritm is stored and used so I can take a look. thanks.

@afewyards

This comment has been minimized.

Copy link

commented Mar 26, 2013

thanks you!

@estahn

This comment has been minimized.

Copy link

commented Apr 4, 2013

Any progress here? The issue we have is with zoom level in different browsers. It will show a part of the other image if there is no spacing.

@evangelion1204

This comment has been minimized.

Copy link

commented May 15, 2013

We too have the same problem with zooming and mobile devices that interpolate sprites on Android devices.
Android devices doesn't support images bigger than 4096px and start scaling them down to bad quality. Because of that it is not possible to use a big sprite in responsive designs.

@Raibaz

This comment has been minimized.

Copy link

commented May 23, 2013

Same problem here, been looking into the smart layout to use the sprite on an iPad < retina, but i need to have the images spaced inside the sprite...any progress on this?

@chriseppstein

This comment has been minimized.

Copy link
Member

commented May 23, 2013

We should implement this feature.

@chriseppstein chriseppstein reopened this May 23, 2013

@afewyards

This comment has been minimized.

Copy link

commented May 23, 2013

worked on it for a bit.. but no result yet unfortunately..

@evangelion1204

This comment has been minimized.

Copy link

commented May 23, 2013

Well I got a working solution for me but I never wasted a thought that the spacing changes from sprite to sprite, thats something I didn't need until now.
But I don't really have an idea how to contribute to the project, need to read the FAQ for that first

@ArekBartnik

This comment has been minimized.

Copy link

commented May 24, 2013

Could someone explain why this is a limitation of smart layout but not horizontal or vertical?

@afewyards

This comment has been minimized.

Copy link

commented May 24, 2013

^^ scottdavis wrote: "because of the packing algorithm. If you want to use spacing use horizontal or vertical."

@materliu

This comment has been minimized.

Copy link

commented Jul 17, 2013

yeah, we truly nead the spacing fun when we use smart sprite

@piouPiouM

This comment has been minimized.

Copy link
Contributor

commented Jul 17, 2013

One suggestion: you should only use smart layout with elements having the dimensions of the images to display (and a display: block for example). This will prevent any overflow. If this is not possible with some elements, then store them in a vertical sprite.

In addition, instead of loading a huge sprite will have a significant weight maybe split it in multiple sprites? Of course, this requires additional HTTP requests, but you already save many using sprites.

@therazor

This comment has been minimized.

Copy link

commented Feb 16, 2015

There seems to be a patch, but the feature is not working as of v 1.0.3.
Is it still unmerged?

@jo32

This comment has been minimized.

Copy link

commented Jul 20, 2015

http://stackoverflow.com/questions/16793278/generate-sprites-with-compass-with-smart-layout-and-spacing

Somebody has already patch it for us. Maybe it is time to add this feature?

@borys-p

This comment has been minimized.

Copy link

commented Feb 4, 2016

How about a global spacing for all sprites in one map? This should be much easier to implement. It's been almost four years since the first report and this issue is still open...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.