refactored for cleanliness

This commit is contained in:
Scott Davis 2011-09-06 15:48:10 -04:00
parent b7f44a48d3
commit 8ccdab41cc

View File

@ -7,21 +7,25 @@ module Compass
SMART = 'smart'
def smart?
@kwargs.get_var('layout').value == SMART
layout == SMART
end
def horizontal?
@kwargs.get_var('layout').value == HORIZONTAL
layout == HORIZONTAL
end
def diagonal?
@kwargs.get_var('layout').value == DIAGONAL
layout == DIAGONAL
end
def layout
@layout ||= @kwargs.get_var('layout').value
end
# Calculates the overal image dimensions
# collects image sizes and input parameters for each sprite
def compute_image_positions!
case @kwargs.get_var('layout').value
case layout
when SMART
calculate_smart_positions
when DIAGONAL