fixed horizontal height and width calculation
This commit is contained in:
parent
4aa052d9e4
commit
1cdfab7c03
@ -100,11 +100,11 @@ module Compass
|
||||
end
|
||||
|
||||
def height_for_horizontal_layout
|
||||
@height = @images.map {|image| image.height + image.spacing}.max
|
||||
@height = @images.map {|image| image.height + image.offset}.max
|
||||
end
|
||||
|
||||
def width_for_horizontal_layout
|
||||
@images.inject(0) { |sum, image| sum += (image.width + image.offset) }
|
||||
@images.inject(0) { |sum, image| sum += (image.width + image.spacing) }
|
||||
end
|
||||
|
||||
def width_for_vertical_layout
|
||||
|
@ -154,6 +154,7 @@ class SpriteMapTest < Test::Unit::TestCase
|
||||
base = horizontal("spacing" => Sass::Script::Number.new(10, ['px']))
|
||||
assert_equal [0, 20, 40, 60], base.images.map(&:left)
|
||||
assert_equal [0, 0, 0, 0], base.images.map(&:top)
|
||||
assert_equal 80, base.width
|
||||
end
|
||||
|
||||
it "should layout horizontaly with position" do
|
||||
|
Loading…
Reference in New Issue
Block a user