class Magick::RVG::Group
end
grp.circle(10, 20, 20).styles(:stroke=>‘blue’)
# The circle will be blue.
grp.line(10,10, 20,20)
# The line will be red.
rvg.g.translate(50, 10).styles(:stroke=>‘red’,:fill=>‘none’) do |grp|
# x-direction and 10 in the y-direction.
# All elements in the group will be translated by 50 in the
Example:
containers with the RVG::StructureConstructors#g method.
Create groups within
Groups can be reused with the RVG::UseConstructors#use method.
nested groups unless overridden by a nested container or the object itself.
on the group are used by contained objects such as shapes, text, and
Group objects are containers. That is, styles and transforms defined
Define a collection of shapes, text, etc. that can be reused.
def <<(obj)
- Private: -
def <<(obj) @content << obj end
def add_primitives(gc)
- Private: -
def add_primitives(gc) gc.push add_transform_primitives(gc) add_style_primitives(gc) @content.each { |element| element.add_primitives(gc) } gc.pop end
def initialize
def initialize super @content = Content.new yield(self) if block_given? end
def ref(x, y, _width, _height)
- Private: -
def ref(x, y, _width, _height) translate(x, y) if x != 0 || y != 0 end