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 103 103: def initialize(element, x=0, y=0, width=nil, height=nil) 104: super() 105: 106: # If the element is not a group, defs, symbol, or rvg, 107: # wrap a group around it so it can get a transform and 108: # possibly a new viewport. 109: if ! element.respond_to?(:ref) 110: @element = Group.new 111: @element << element.deep_copy 112: else 113: @element = element.deep_copy 114: end 115: @element.ref(x, y, width, height) 116: end