polygon.rb

Path: polygon.rb
Last Update: Thu May 15 14:59:09 -0300 2008

Draw one shape based in relative node points.

Options

  • :x and :y - Initial position.
  • :content - Facade to ShapeContent with same parameters.
  • :border - Facade to Border with same parameters.

Examples

 doc.polygon :x => 3.5, :y => 5.5 do
   node :x => 4,  :y => 0
   node :x => 0,  :y => -4
   node :x => -4, :y => 0
   node :x => 0,  :y => 4
 end

 doc.polygon :x => 3.5, :y => 4.5 do
   node :x => 2,  :y => 2
   node :x => 2,  :y => -2
   node :x => -2, :y => -2
 end

 doc.polygon :x => 1, :y => 5, :border => {:width => 2, :linejoin => 1} do
   node :x => 2,  :y => 2/2
   node :x => 2*2,:y => -2
   node :x => -1, :y => -3
   node :x => 2,  :y => 1
   node :x => 3,  :y => 2
 end

[Validate]