--
-$Id: ChangeLog 21 2005-04-02 22:26:40Z tilman $
+$Id: ChangeLog 22 2005-04-02 22:29:50Z tilman $
++
2005-04-03 Tilman Sauerbeck (tilman at code-monkey de)
* lib/redact/part.rb: Some cosmetic changes
* lib/redact/part.rb: Use symbols instead of constants for text
effects
+ * lib/redact/part.rb: Code cleanup
2005-04-02 Tilman Sauerbeck (tilman at code-monkey de)
* lib/redact/part.rb: Made 'step' and 'aspect' parameters
#--
-# $Id: part.rb 21 2005-04-02 22:26:40Z tilman $
+# $Id: part.rb 22 2005-04-02 22:29:50Z tilman $
#
# Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de)
#
pairs.map { |p| p.hex }
end
- def map_aspect_preference
- case @aspect_preference
- when :none
- 0
- when :vertical
- 1
- when :horizontal
- 2
- when :both
- 3
- else
- raise(RedactError, "invalid aspect preference value - " +
- @aspect_preference.to_s)
- end
- end
-
def to_eet_name
"Edje_Part_Description"
end
def to_eet_properties
+ asp_pref = case @aspect_preference
+ when :none: 0
+ when :vertical: 1
+ when :horizontal: 2
+ when :both: 3
+ else
+ raise(RedactError, "invalid aspect preference value - " +
+ @aspect_preference.to_s)
+ end
+
{"state.name" => [@name],
"state.value" => [@value, :double],
"visible" => [@visible],
"step.y" => [@step[1]],
"aspect.min" => [@aspect[0], :double],
"aspect.max" => [@aspect[1], :double],
- "aspect.prefer" => [map_aspect_preference, :char],
+ "aspect.prefer" => [asp_pref, :char],
"rel1.relative_x" => [@rel[0].rel[0], :double],
"rel1.relative_y" => [@rel[0].rel[1], :double],
"rel1.offset_x" => [@rel[0].offset[0]],