--
-$Id: ChangeLog 20 2005-04-02 22:15:29Z tilman $
+$Id: ChangeLog 21 2005-04-02 22:26:40Z tilman $
++
2005-04-03 Tilman Sauerbeck (tilman at code-monkey de)
* lib/redact/part.rb: Made 'text_class' and 'color_class' parameters
writable
* lib/redact/part.rb: Some cosmetic changes
+ * lib/redact/part.rb: Use symbols instead of constants for text
+ effects
2005-04-02 Tilman Sauerbeck (tilman at code-monkey de)
* lib/redact/part.rb: Made 'step' and 'aspect' parameters
#--
-# $Id: part.rb 20 2005-04-02 22:15:29Z tilman $
+# $Id: part.rb 21 2005-04-02 22:26:40Z tilman $
#
# Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de)
#
end
class TextPart < Part
- EFFECT_NONE = 0
- EFFECT_PLAIN = 1
- EFFECT_OUTLINE = 2
- EFFECT_SOFT_OUTLINE = 3
- EFFECT_SHADOW = 4
- EFFECT_SOFT_SHADOW = 5
- EFFECT_OUTLINE_SHADOW = 6
- EFFECT_OUTLINE_SOFT_SHADOW = 7
-
attr_accessor :effect
def initialize(collection, id, name)
super
@type = TYPE_TEXT
- @effect = EFFECT_NONE
+ @effect = :none
end
protected
end
def to_eet_properties
- super.merge!({"effect" => [@effect, :char]})
+ effect = case @effect
+ when :none: 0
+ when :plain: 1
+ when :outline: 2
+ when :soft_outline: 3
+ when :shadow: 4
+ when :soft_shadow: 5
+ when :outline_shadow: 6
+ when :outline_soft_shadow: 7
+ else
+ raise(RedactError, "invalid effect value - #{@effect}")
+ end
+
+ super.merge!({"effect" => [effect, :char]})
end
end