| Module | Magick::RVG::Stylable |
| In: |
lib/rvg/stylable.rb
|
This module is mixed into classes that can have styles.
This method can be used with any RVG, Group, Use, Text, or shape object. The argument is a hash. The style names are the hash keys. The style names and values are:
# File lib/rvg/stylable.rb, line 108
108: def styles(styles)
109: @styles.set(styles)
110: yield(self) if block_given?
111: self
112: end
For each style that has a value, add a style primitive to the gc. Use splat to splat out Array arguments such as stroke_dasharray.
# File lib/rvg/stylable.rb, line 63
63: def add_style_primitives(gc)
64: @styles.each_value do |style, value|
65: if value.respond_to? :add_primitives
66: value.add_primitives(gc, style)
67: else
68: gc.__send__(style, *value)
69: end
70: end
71: end