This commit is contained in:
Scott Davis 2011-03-21 21:16:55 -04:00
parent a9b6d8cfde
commit 46eec5362d
4 changed files with 33 additions and 1 deletions

View File

@ -1,7 +1,7 @@
PATH
remote: .
specs:
compass (0.11.beta.3.01b9cd3)
compass (0.11.beta.3.a9b6d8c)
chunky_png (~> 1.1.0)
sass (>= 3.1.0.alpha.249)

View File

@ -55,6 +55,7 @@ module Compass
image
end
end
# Calculates the overal image dimensions
# collects image sizes and input parameters for each sprite
def compute_image_positions!

View File

@ -51,6 +51,10 @@ module Compass
Digest::MD5.file(file).hexdigest
end
def mtime
File.mtime(file)
end
private
def dimensions
@dimensions ||= Compass::SassExtensions::Functions::ImageSize::ImageProperties.new(file).size

View File

@ -441,4 +441,31 @@ describe Compass::Sprites do
CSS
end
it "should calculate corret sprite demsions when givin spacing via issue#253" do
css = render <<-SCSS
$squares-spacing: 10px;
@import "squares/*.png";
.foo {
@include sprite-background-position($squares-sprites, "twenty-by-twenty");
}
.bar {
@include sprite-background-position($squares-sprites, "ten-by-ten");
}
SCSS
image_size('squares-*.png').should == [20, 40]
css.should == <<-CSS
.squares-sprite {
background: url('/squares-e3c68372d9.png') no-repeat;
}
.foo {
background-position: 0 -20px;
}
.bar {
background-position: 0 0;
}
CSS
end
end