lib/compass/sass_extensions/sprites/row_fitter.rb in compass-0.12.alpha.0 vs lib/compass/sass_extensions/sprites/row_fitter.rb in compass-0.12.alpha.1

- old
+ new

@@ -8,10 +8,16 @@ attr_reader :images, :rows def_delegators :rows, :[] def initialize(images) - @images = images.sort {|a,b| a.height <=> b.height } + @images = images.sort do |a,b| + if a.height == b.height + b.width <=> a.width + else + a.height <=> b.height + end + end @rows = [] end def fit!(style = :scan) send("#{style}_fit") \ No newline at end of file