Class/Module Index [+]

Quicksearch

Compass::SassExtensions::Sprites::ChunkyPngEngine

Public Instance Methods

construct_sprite() click to toggle source
# File lib/compass/sass_extensions/sprites/engines/chunky_png_engine.rb, line 12
def construct_sprite
  @canvas = ChunkyPNG::Image.new(width, height, ChunkyPNG::Color::TRANSPARENT)
  images.each do |image|
    input_png  = ChunkyPNG::Image.from_file(image.file)
    canvas.replace! input_png, image.left, image.top
  end
end
save(filename) click to toggle source
# File lib/compass/sass_extensions/sprites/engines/chunky_png_engine.rb, line 20
def save(filename)
  if canvas.nil?
    construct_sprite
  end
  
  canvas.save(filename,  Compass.configuration.chunky_png_options)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.