refactored for cleanliness
This commit is contained in:
parent
b7f44a48d3
commit
8ccdab41cc
@ -7,21 +7,25 @@ module Compass
|
|||||||
SMART = 'smart'
|
SMART = 'smart'
|
||||||
|
|
||||||
def smart?
|
def smart?
|
||||||
@kwargs.get_var('layout').value == SMART
|
layout == SMART
|
||||||
end
|
end
|
||||||
|
|
||||||
def horizontal?
|
def horizontal?
|
||||||
@kwargs.get_var('layout').value == HORIZONTAL
|
layout == HORIZONTAL
|
||||||
end
|
end
|
||||||
|
|
||||||
def diagonal?
|
def diagonal?
|
||||||
@kwargs.get_var('layout').value == DIAGONAL
|
layout == DIAGONAL
|
||||||
|
end
|
||||||
|
|
||||||
|
def layout
|
||||||
|
@layout ||= @kwargs.get_var('layout').value
|
||||||
end
|
end
|
||||||
|
|
||||||
# Calculates the overal image dimensions
|
# Calculates the overal image dimensions
|
||||||
# collects image sizes and input parameters for each sprite
|
# collects image sizes and input parameters for each sprite
|
||||||
def compute_image_positions!
|
def compute_image_positions!
|
||||||
case @kwargs.get_var('layout').value
|
case layout
|
||||||
when SMART
|
when SMART
|
||||||
calculate_smart_positions
|
calculate_smart_positions
|
||||||
when DIAGONAL
|
when DIAGONAL
|
||||||
|
Loading…
Reference in New Issue
Block a user