Browse files

Corrected the sprite image path

  • Loading branch information...
1 parent 162b349 commit 13ad00beb111e35f2f24eb6e0491bdbf5b19683d @ldsenow committed Jan 24, 2012
View
4 src/Infinity.WebMelody.Core/ImageOptimization/SpriteImageCssGenerator.cs
@@ -55,7 +55,8 @@ private void AppendCssClassWithBase64(StringBuilder builder, string cssClassName
builder.AppendLine("}");
}
- private void AppendCssClass(StringBuilder builder, string cssClassName, int width, int height, int positionX, int positionY, string spritePath)
+ private void AppendCssClass(StringBuilder builder, string cssClassName, int width, int height,
+ int positionX, int positionY, string spritePath)
{
builder.AppendFormat(".{0}{{\r\n", cssClassName);
builder.AppendFormat("\twidth: {0}px;\r\n", width);
@@ -66,6 +67,7 @@ private void AppendCssClass(StringBuilder builder, string cssClassName, int widt
public string GetRelativeSpritePath(string cssDirectory, string imagePath)
{
+ cssDirectory = cssDirectory.EndsWith("\\") ? cssDirectory : cssDirectory + "\\";
var uri = new Uri(cssDirectory);
return uri.MakeRelativeUri(new Uri(imagePath)).ToString();
}
View
10 src/Infinity.WebMelody.Tests/sass_engine.cs
@@ -54,15 +54,5 @@ public class sass_engine {
Debug.WriteLine("Used " + stopwatch.ElapsedMilliseconds + "ms");
Assert.IsTrue(css.Contains("black"));
}
-
- [Test]
- public void com()
- {
- var fc = new FileCombiner(new FileSystemWrapper());
- var currentPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "gems");
- var files = Directory.GetFiles(currentPath, "*.rb", SearchOption.AllDirectories);
- var file = fc.CombineText(files);
- File.WriteAllText(Path.Combine(currentPath, "sass_all_one.rb"), file);
- }
}
}

0 comments on commit 13ad00b

Please sign in to comment.