Sha256: 38e4881c084418b2a446b9272835abdc9e4b886d6ee0035f3386211be11b9638

Contents?: true

Size: 874 Bytes

Versions: 4

Compression:

Stored size: 874 Bytes

Contents

require "base64"


module Sass::Script::Functions
  # utilities used by code dynamically added by the parser.
  # The parser adds _slice_offset_x/y to get the offset of a slice (which
  # may be dynamically calculated for spriting). Because apparently function
  # calls may not be used inside expressions, an amount to add to the slice
  # offset is passed in as well.
  def _slice_offset_x(slice_name, start_offset = 0)
    slice = Chance._current_instance.get_slice(slice_name.value)
    raise "Invalid slice" if slice.nil?

    return Sass::Script::Number.new(slice[:imaged_offset_x] + Integer(start_offset))
  end

  def _slice_offset_y(slice_name, start_offset = 0)
    slice = Chance._current_instance.get_slice(slice_name.value)
    raise "Invalid slice" if slice.nil?

    return Sass::Script::Number.new(slice[:imaged_offset_y] + Integer(start_offset))
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sproutcore-1.5.0.pre.5 vendor/chance/lib/chance/sass_extensions.rb
sproutcore-1.5.0.pre.4.1 vendor/chance/lib/chance/sass_extensions.rb
sproutcore-1.5.0.pre.4 vendor/chance/lib/chance/sass_extensions.rb
sproutcore-1.5.0.pre.3 vendor/chance/lib/chance/sass_extensions.rb