| Class | Magick::RVG::Use |
| In: |
lib/rvg/container.rb
|
| Parent: | Object |
A Use object allows the re-use of RVG and RVG::Group objects within a container. Create a Use object with the RVG::UseConstructors#use method.
In a container, Use objects are created indirectly via the RVG::UseConstructors#use method. The x and y arguments can be used to specify an additional translation for the group. The width and height arguments specify a width and height for referenced RVG objects.
# File lib/rvg/container.rb, line 104
104: def initialize(element, x=0, y=0, width=nil, height=nil)
105: super()
106:
107: # If the element is not a group, defs, symbol, or rvg,
108: # wrap a group around it so it can get a transform and
109: # possibly a new viewport.
110: if ! element.respond_to?(:ref)
111: @element = Group.new
112: @element << element.deep_copy
113: else
114: @element = element.deep_copy
115: end
116: @element.ref(x, y, width, height)
117: end