public virtual Sprite Add(BackgroundImageClass image) { var imageKey = new ImageMetadata(image); if (spriteList.ContainsKey(imageKey)) return spriteList[imageKey]; var currentPositionToReturn = SpriteContainer.Width; SpriteContainer.AddImage(image); var sprite = new Sprite(currentPositionToReturn, spriteIndex); if (SpriteContainer.Size >= config.SpriteSizeLimit) Flush(); spriteList.Add(imageKey, sprite); return sprite; }
public string InjectSprite(string originalCss, BackgroundImageClass image, Sprite sprite) { return originalCss.Replace(image.OriginalClassString, image.Render(sprite)); }