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

Feature request: adding 1px margin on all images to support browser zoom #15

Closed
levraipixel opened this issue Mar 31, 2012 · 13 comments
Closed

Comments

@levraipixel
Copy link

When browsers zoom, sometimes a line of the previous image appears on top of the wanted image. I suggest adding a 1px margin around all images to prevent this ugly effect from happening.

Y.

@jakesgordon
Copy link
Owner

If you are using the :horizontal or :vertical layout options, then there is also an (optional) :padding option you can use.

Unfortunately its not supported when using the :packed layout option. I'll look into adding that in a future release.

Thanks

@halida
Copy link
Contributor

halida commented Apr 10, 2012

when I using padding, all image size are bigger, I need a margin..

@jakesgordon
Copy link
Owner

Oops, sorry, my mistake. You're right, you need a margin option, not padding - to give the image more room in the spritesheet, but not in the x,y,w,h coords generated for the css.

I'll try to add that in the next release

@levraipixel
Copy link
Author

Yep, that's exactly as @halida said. But I think you've already got that :)

@jakesgordon
Copy link
Owner

FYI: I've merged in @halida's pull request (Thanks!) into the master branch to add the new :margin option to the :horizontal and :vertical layout.

I'll see if I can get some time this weekend to also support padding/margin in the :packed layout and then see about releasing a minor update to the gem itself.

@levraipixel
Copy link
Author

Hi Jake,
Great news ! Looking forward to having this on :packed layout ;)
Thx

@jakesgordon
Copy link
Owner

Ok. It's done (on master branch). You can now specify :margin => 1 for any of the layout formats.

I probably won't publish a new gem version for a little while, I'll try to accumulate a few more fixes before publishing, if that's a problem let me know - I can be persuaded to change my mind!

@levraipixel
Copy link
Author

It works great, thanks !

@levraipixel
Copy link
Author

Does your comment mean that you won't push this change to rubygem ? I think it's really a great improvement since it prevents zooming from having a very bad effect :(
I'm using your gem on production and I dislike using :git => ... in my Gemfile, it's really too dangerous !

@jakesgordon
Copy link
Owner

No problem, I'll try to go through the last open issues and push a new version... maybe at the weekend ?

@levraipixel
Copy link
Author

take your time, this weekend or the next are both good options ! Thx a lot

@jakesgordon
Copy link
Owner

FYI: I've pushed a new sprite-factory gem (v1.5.0) with this change (and a couple others). You can read about it on codeincomplete.com

@levraipixel
Copy link
Author

this is huge, you made my day =)

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

3 participants