#--
-# $Id: part.rb 69 2005-09-19 20:17:07Z tilman $
-#
# Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de)
#
# Permission is hereby granted, free of charge, to any person obtaining
@color_class = ""
end
+ def inherit(other)
+ unless other.is_a?(Description)
+ raise(ArgumentError, "Cannot inherit from description")
+ end
+
+ prot = ["@name", "@value"]
+
+ (instance_variables - prot).each do |v|
+ n = other.instance_variable_get(v.intern)
+ n = n.dup rescue n
+ instance_variable_set(v.intern, n)
+ end
+ end
+
def visible=(v)
@visible = (v == true)
end
@fill_smooth = (v == true)
end
- def fill_pos_rel=(x, y)
+ def set_fill_pos_rel(x, y)
@fill_pos_rel = [x.to_f, y.to_f]
end
- def fill_pos_abs=(x, y)
+ def set_fill_pos_abs(x, y)
@fill_pos_abs = [x.to_i, y.to_i]
end
- def fill_rel=(x, y)
+ def set_fill_rel(x, y)
@fill_rel = [x.to_f, y.to_f]
end
- def fill_abs=(x, y)
+ def set_fill_abs(x, y)
@fill_abs = [x.to_i, y.to_i]
end