glue icon indicating copy to clipboard operation
glue copied to clipboard

Add support to only create sprites with dividable width and height

Open peterrietzler opened this issue 11 years ago • 2 comments

If the generated sprite would have an odd width or height, then add transparent pixels to width or height, so that images can always be downscaled properly without losing "parts of a pixel" (e.g. add 1 pixel to have even width, height if 2x and 1x is targeted)

E.g. when a resulting retina (2x) sprite has a size of 100x99, then the size of the standard (1x) sprite would be 50x49.5. The generated CSS media query sets the background-size property to either 50x50 or 50x49 in this case - and you will e.g. experience "moving icons" when you use it for hover/active effects.

peterrietzler avatar Mar 06 '13 15:03 peterrietzler

+1

erickreutz avatar Jun 20 '13 01:06 erickreutz

@peterrietzler I think the best solution would be to make glue show a warning if your input image sizes are not divisible by any of the ratios. Thoughts?

jorgebastida avatar Dec 23 '13 22:12 jorgebastida