Skip to content

Commit a3655d9

Browse files
committed
fix bug
1 parent aa5786f commit a3655d9

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

lib/css_sprite/sprite.rb

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,10 @@ def output_less(directory, results)
256256
results.each do |result|
257257
f.print "#{class_name(result[:name])} \{\n"
258258
f.print " background-position: #{-result[:x]}px #{-result[:y]}px;\n"
259-
#if (result[:width]!=@default_width || result[:height]!=@default_height)
260-
f.print " width: #{result[:width]}px;\n" #if result[:width]
261-
f.print " height: #{result[:height]}px;\n" #if result[:height]
262-
#end
259+
if (result[:width]!=@default_width || result[:height]!=@default_height)
260+
f.print " width: #{result[:width]}px;\n" if result[:width]
261+
f.print " height: #{result[:height]}px;\n" if result[:height]
262+
end
263263
f.print " \}\n"
264264
end
265265
end
@@ -340,14 +340,15 @@ def image_properties(image, directory)
340340
# if the hover class has the same width and height property with not hover class,
341341
# then the hover class does not need width and height
342342
def need_wh?(image, directory)
343-
name = get_image_name(image, directory)
344-
if hover?(name) or active?(name)
345-
not_file = image.filename.sub(/[_-](hover|active)\./, '.').sub(/[_-](hover|active)\//, '/')
346-
if File.exist?(not_file)
347-
not_image = get_image(not_file)
348-
return false if image.columns == not_image.columns and image.rows == not_image.rows
349-
end
350-
end
343+
#allways return true
344+
#name = get_image_name(image, directory)
345+
#if hover?(name) or active?(name)
346+
#not_file = image.filename.sub(/[_-](hover|active)\./, '.').sub(/[_-](hover|active)\//, '/')
347+
#if File.exist?(not_file)
348+
#not_image = get_image(not_file)
349+
#return false if image.columns == not_image.columns and image.rows == not_image.rows
350+
#end
351+
#end
351352
return true
352353
end
353354

0 commit comments

Comments
 (0)