adjust spritmap class to usr load path to get relative sprite names
This commit is contained in:
parent
71494cecfe
commit
0984b48b24
@ -1,7 +1,7 @@
|
||||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
compass (0.12.0.alpha.0.5e89865)
|
||||
compass (0.12.0.alpha.0.71494ce)
|
||||
chunky_png (~> 1.2)
|
||||
fssm (>= 0.2.7)
|
||||
sass (~> 3.1)
|
||||
|
@ -17,11 +17,19 @@ module Compass
|
||||
name, path = Compass::SpriteImporter.path_and_name(uri)
|
||||
files = Compass::SpriteImporter.files(uri)
|
||||
sprites = files.map do |sprite|
|
||||
sprite.gsub("#{Compass.configuration.images_path}/", "")
|
||||
relative_name(sprite)
|
||||
end
|
||||
new(sprites, path, name, context, kwargs)
|
||||
end
|
||||
|
||||
def self.relative_name(sprite)
|
||||
Compass.configuration.sprite_load_path.each do |path|
|
||||
if sprite.include?(path)
|
||||
return sprite.gsub("#{path}/", "")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def initialize(sprites, path, name, context, kwargs)
|
||||
@image_names = sprites
|
||||
@path = path
|
||||
|
Loading…
Reference in New Issue
Block a user