passing tests for new vertical layout based on file size
This commit is contained in:
parent
7a183754b7
commit
b581d2e1a7
@ -7,7 +7,7 @@ GIT
|
||||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
compass (0.12.0.alpha.0.38cf0e5)
|
||||
compass (0.12.0.alpha.0.7a18375)
|
||||
chunky_png (~> 1.2)
|
||||
fssm (>= 0.2.7)
|
||||
sass (~> 3.1)
|
||||
|
@ -16,6 +16,7 @@ module Compass
|
||||
calculate_horizontal_positions
|
||||
calculate_width
|
||||
else
|
||||
@images.sort! {|a,b| File.size(b.file) <=> File.size(a.file)} #put small images first
|
||||
calculate_width
|
||||
calulate_vertical_postions
|
||||
calculate_height
|
||||
|
@ -80,7 +80,7 @@ module Compass
|
||||
end
|
||||
end
|
||||
|
||||
# Returns the sass _options for this sprite
|
||||
# Returns the sass_options for this sprite
|
||||
def self.sass_options(name, importer, options)
|
||||
options.merge!(:filename => name, :syntax => :scss, :importer => importer)
|
||||
end
|
||||
|
1416
test/fixtures/stylesheets/compass/css/sprites.css
vendored
1416
test/fixtures/stylesheets/compass/css/sprites.css
vendored
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 103 KiB |
@ -115,5 +115,11 @@ class SpriteMapTest < Test::Unit::TestCase
|
||||
FileUtils.rm base.filename
|
||||
end
|
||||
|
||||
it "should generate vertical sprites in decending order" do
|
||||
sizes = @base.images.map{|image| File.size(image.file) }
|
||||
assert_equal sizes.min, File.size(@base.images.first.file)
|
||||
assert_equal sizes.max, File.size(@base.images.last.file)
|
||||
end
|
||||
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user