Module | Magick::RVG::StructureConstructors |
In: |
lib/rvg/embellishable.rb
|
Defines a group.
This method constructs a new Group container object. The styles and transforms specified on this object will be used by objects contained within, unless overridden by an inner container or the contained object itself. Define grouped elements by calling RVG::Embellishable methods within the associated block.
# File lib/rvg/embellishable.rb, line 377 377: def g(&block) 378: group = Group.new(&block) 379: @content << group 380: return group 381: end
Establishes a new viewport. [x, y] is the coordinate of the upper-left corner within the containing viewport. This is a container method. Styles and transforms specified on this object will be used by objects contained within, unless overridden by an inner container or the contained object itself.
# File lib/rvg/embellishable.rb, line 355 355: def rvg(cols, rows, x=0, y=0, &block) 356: rvg = Magick::RVG.new(cols, rows, &block) 357: begin 358: x, y = Float(x), Float(y) 359: rescue ArgumentError 360: args = [cols, rows, x, y] 361: raise ArgumentError, "at least one argument is not convertable to Float (got #{args.collect {|a| a.class}.join(', ')})" 362: end 363: rvg.corner(x, y) 364: @content << rvg 365: return rvg 366: end